Those new to programming should follow these steps for completing a game:
1) Write down a complete outline of what you want your game to do
[example]
* Donkey kong:
* A gorilla stands at the top of the screen tossing barrels down sloped ramps and ladders
* The player must jump over barrels and climb ladders in order to rescue the fair maiden penelope
* The player can gain the use of a hammer which allows the destruction of barrels, however the player cannot jump while using it
* Once the player reaches penelope, Kong will then kidnap her once again progressing the game to the next level
* The player will gain score for jumping over the barrels and destroying them with the hammer
* The player can lose a life by touching either barrels, kong, or falling from the ramps
* A timer will be counting down and will represent the bonus points awarded after reaching penelope
* After a few levels have progressed, the player will then rescue penelope and win the game
Note that this is just a general outline of what you would like the game to do. This should only represent the goals of the game, and a brief outline of the game mechanics. Nothing to in depth or thorough about it. This will be a reference while your coding the game to ensure what your designing meets the initial goals and ideas set forth. Do not keep changing this as you think of new ideas, only change it if you've come up with something completely different, or if the initial premise has changed.
2)Start SMALL! since you're new to coding don't start on the full fledged project from the get go! Since you need to learn the basics of the language, and about game design in general, I suggest starting by tinkering around with basic functionality. Making a player jump across the screen sounds easy right?! but did you know that loops and slight physics are required for this? Also do you understand how the screen is even prepared to draw your player let alone animating him? You will once you go through a few of these tutorials. They show how a basic kernal is created and looped through. Use those tutorials as a base to ensure your compiler and IDE is setup correctly. If those do not compile and run then you have some issues that need fixed before proceeding.
3) Once you understand the basics of entering your main loop, and then gosub out to desired functions, you can start building a prototyped framework for your game. YOU DO NOT HAVE TO GET EVERYTHING RIGHT THE FIRST TIME! Very important! I've seen many people get burnt out before anything really was done simply because they kept tweaking their code over and over, yet made no real progress at all! Write down everything you want the game to do, down to the smallest detail and keep it on hand, you'll be referring to this allot during your coding. Also be sure to comment plenty while you're writing your code, this will come in handy later. (just trust me on this one)
[example]
rem set batari kernel options
set tv ntsc
set romsize 4k
set kernel_options playercolors player1colors pfcolors
rem Variables, we have 26 of them for general usage
rem Setting a variable to something.something uses fixed point math, or in other words floating mathematics for decimal movement
rem Set players Y position to decimal
dim P0posY = player0y.a
dim Gravity = b.c
rem set players initial position
player0y = 50
player0x = 20
rem Give gravity an initial value
Gravity = 1
rem Our main game loop for a simple jumping test
MAIN_LOOP
gosub get_input
gosub do_physics
gosub level_data
drawscreen
goto MAIN_LOOP
get_input
rem if we press the fire button the player will move up on the screen
if joy0fire then P0posY = P0posY - 1.99
if joy0left then player0x = player0x - 1
if joy0right then player0x = player0x + 1
return
do_physics
rem Apply gravity on players position, also make sure player cannot fall off the screen
P0posY = P0posY + Gravity
if P0posY >= 81 then P0posY = P0posY - 1
return
level_data
rem this holds current level and player graphics
rem has to be read before drawscreen each loop
pfcolors:
$08
$08
$08
$08
$08
$08
$08
$08
$08
$08
$C4
end
playfield:
................................
................................
................................
................................
................................
................................
................................
................................
................................
................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end
player0color:
$1E
$1E
$1E
$1E
$1E
$1E
$1E
$1E
end
player0:
%11111111
%10000001
%10011001
%10100101
%10000001
%10100101
%10000001
%11111111
end
return
This is a basic program with calls to subroutines which perform a simple task. When you hold the fire button your player moves up, and when you let go gravity gets added to your current position causing you to fall until you hit the ground. This isn't how you wan't your game to react, so you have to think now how you will make your player jump movement work like it should. How do you set a value by tapping the fire button and have him launch into the air a certain height, then fall back down. I would suggest thinking this out logically, and then write some test code using this template and see how it works out. If you simply cannot figure it out, then you can get the answers and cheat in this example by RT. Start small like this, use it to test different functions your game will have, and save out the working code! You'll reuse it later, so keep what works on hand.
4) Start migrating your working test code into your main project and start working in all your desired functionality.
5) A few months later you'll have a decent looking title (hopefully)
6) If you have ANY issues, be sure to keep in contact with us here, I'm sure we'll be more than happy to assist where we can. Use our knowledge as a valuable resource and you'll make much faster progression.
7) Don't give up when something stumps you! See suggestion #6, it's easy to get overwhelmed when your new at something, but given some time, things have a way of going click! and making sense.
Aside from the afore mentioned, I can't think of anything else to suggest at this hour.
Hope to see a working title from you in the near future. There are plenty of code examples here, but you might have to go looking for em'