Starting from scratch making a game for ipad
by Raymond Gaustadnes · in Game Design and Creative Issues · 12/17/2011 (6:01 am) · 6 replies
I guess I want to learn the logics behind game making, not just the programming part.
I have little clues on how to go about setting up the code for a game, so I'm making this thread here.
Down the line, I would like to have completed 3 minigames in the following order:
1. "Pacman clone" - singlescreen "maze" levels where you collect stuff and avoid enemies chasing after yourself.
2. "Wonderboy clone" - a small sideway view fantasy game where the aim is to go from level to level, collecting coins, acquiring better gear and killing end bosses in a fantasy setting.
3. top-down view scifi spaceshooter - think r-type on a smaller scale, you control a spaceship that get upgrades and shoot your way level through level until you reach the end boss.
-------------------------------------------
To learn the very basics of setting up a game, I was thinking of starting with something simple, the "pacman clone"
What I want for this game:
Main menu (start new game, highscore, credits, options(sound/music))
Game screen (single screen levels where the mazes/walls/objects are premade and loaded when level begins)
Player should start the game with 3 lives.
Player is constant, no upgrades other than the invincibility.
Enemies are constant, color changes/different images for each of them at level start.
Levels have timers, when timer is about to run out, enemies should change colors and speed up.
Player should lose live when colliding with enemy.
Player should gain score when picking up/walking over the ordinary items/coins.
Player should gain bonus score when picking up/walking over special items.
Player should become invincible when picking up/walking over enemy-killing items, similar to eating the ghosts in pacman.
Player and enemies can't walk through walls.
Level ends when all the ordinary items/coins are picked up.
When game ends/player lost 3 lives, player should be able to sign his name into the highscore if score is better than the current top 10, if not, highscore list is simply shown.
With each level cleared, the speed of the game should increase slightly.
Game is controlled using a virtual 4-way d-pad on the ipad screen.
My dilemma now is, how do I go about creating a game like this one?
Do I:
create a screen for intro splash screen (my logo and the game logo)
create a screen for the main menu
create a screen for highscores
create a screen for options
create a screen for credits
create a screen for level 1
create a screen for level 2
...
create a screen for level 20
Do I make a code file for player?
Do I make a code file for each of the 4 enemies, even though they are supposed to act the same, with slightly different graphics/appearances?
Do I make a code file for the ordinary objects/coins, enemy killers and special bonus score objects?
I have little clues on how to go about setting up the code for a game, so I'm making this thread here.
Down the line, I would like to have completed 3 minigames in the following order:
1. "Pacman clone" - singlescreen "maze" levels where you collect stuff and avoid enemies chasing after yourself.
2. "Wonderboy clone" - a small sideway view fantasy game where the aim is to go from level to level, collecting coins, acquiring better gear and killing end bosses in a fantasy setting.
3. top-down view scifi spaceshooter - think r-type on a smaller scale, you control a spaceship that get upgrades and shoot your way level through level until you reach the end boss.
-------------------------------------------
To learn the very basics of setting up a game, I was thinking of starting with something simple, the "pacman clone"
What I want for this game:
Main menu (start new game, highscore, credits, options(sound/music))
Game screen (single screen levels where the mazes/walls/objects are premade and loaded when level begins)
Player should start the game with 3 lives.
Player is constant, no upgrades other than the invincibility.
Enemies are constant, color changes/different images for each of them at level start.
Levels have timers, when timer is about to run out, enemies should change colors and speed up.
Player should lose live when colliding with enemy.
Player should gain score when picking up/walking over the ordinary items/coins.
Player should gain bonus score when picking up/walking over special items.
Player should become invincible when picking up/walking over enemy-killing items, similar to eating the ghosts in pacman.
Player and enemies can't walk through walls.
Level ends when all the ordinary items/coins are picked up.
When game ends/player lost 3 lives, player should be able to sign his name into the highscore if score is better than the current top 10, if not, highscore list is simply shown.
With each level cleared, the speed of the game should increase slightly.
Game is controlled using a virtual 4-way d-pad on the ipad screen.
My dilemma now is, how do I go about creating a game like this one?
Do I:
create a screen for intro splash screen (my logo and the game logo)
create a screen for the main menu
create a screen for highscores
create a screen for options
create a screen for credits
create a screen for level 1
create a screen for level 2
...
create a screen for level 20
Do I make a code file for player?
Do I make a code file for each of the 4 enemies, even though they are supposed to act the same, with slightly different graphics/appearances?
Do I make a code file for the ordinary objects/coins, enemy killers and special bonus score objects?
About the author
Recent Threads
#2
I watched the live stream of pong the other day and was amazed by all the code that even a small game like that really requires, and needless to say, I was lost halfway into it when he started rolling out all the functions for this and that :)
And that is the reason why I'd give it a second attempt on my own, trying to make something similar to pacman for starters.
12/20/2011 (8:36 am)
@ Jonathan : I've gone through the tutorials, even the tutorials made by makeindiegames.com. My "programmers" currently use lua for creating the games, but I initially acquired T2D/iT2D back in february as it looked ideal for me as a designer/painter to help out with the games projects.I watched the live stream of pong the other day and was amazed by all the code that even a small game like that really requires, and needless to say, I was lost halfway into it when he started rolling out all the functions for this and that :)
And that is the reason why I'd give it a second attempt on my own, trying to make something similar to pacman for starters.
#3
also when you went through the tutorials (this may seem like a dumb question, so stick with me on this) but did you copy and paste the code or did you retype it? i know it seems like a strange question, but a lot of people including myself learn programming better when they retype it instead of copy/paste. and personally i have learned more from the T2D tutorials then the iT2D since they are a better flow from beginning to advanced. iT2D jumps right into advanced it feels like.
hope this helps some :)
12/20/2011 (9:28 am)
ah good, so if you've gone through the tutorials then you can probably see how the ninja platformer can be used for pacman. if you have the art for pacman, then you can create the mazes with a tilemap, then for the player code, just remove the yVelocity and camera follow bits, then add key bindings with setLinearVelocityY for up and down movement, and there is the beginnings of the game. now you just need to program enemies and pickups ;)also when you went through the tutorials (this may seem like a dumb question, so stick with me on this) but did you copy and paste the code or did you retype it? i know it seems like a strange question, but a lot of people including myself learn programming better when they retype it instead of copy/paste. and personally i have learned more from the T2D tutorials then the iT2D since they are a better flow from beginning to advanced. iT2D jumps right into advanced it feels like.
hope this helps some :)
#4
I've picked up bits and pieces in the past from tweaking code, but writing code from scratch is hard. But I'm not known for giving up.
I found the new ninja platformer you mentioned and I also came across a pacman clone tutorial here: http://tdn.garagegames.com/wiki/TGB/Tutorials/Pacman
Next step is to study both tutorial to try and figure out how everything works and why it is done this way, and hopefully I'll pick up enough to start working on my own tiny games.
12/20/2011 (2:20 pm)
@Jonathan: my "problem" is to understand the code/commands, when to use this and that and what this and that does when and where..I've picked up bits and pieces in the past from tweaking code, but writing code from scratch is hard. But I'm not known for giving up.
I found the new ninja platformer you mentioned and I also came across a pacman clone tutorial here: http://tdn.garagegames.com/wiki/TGB/Tutorials/Pacman
Next step is to study both tutorial to try and figure out how everything works and why it is done this way, and hopefully I'll pick up enough to start working on my own tiny games.
#5
check for user input
run AI
move enemies
resolve collisions
draw graphics
play sounds
end while
In T2D or iT2d it handles most of that. You mostly just have to handle events like touches/mousedown to update the player character. I recommend, like Jon going through the basic tutorial and then striking out on your own. Anything that stumps you, you can get answered here or possibly in the docs.
I had to learn all of the torque engines from the ground up. That's what I did. You should start simple with a shooter. Let me know if you need any more advice on where to start.
02/03/2012 (12:30 pm)
while( user doesn't exit )check for user input
run AI
move enemies
resolve collisions
draw graphics
play sounds
end while
In T2D or iT2d it handles most of that. You mostly just have to handle events like touches/mousedown to update the player character. I recommend, like Jon going through the basic tutorial and then striking out on your own. Anything that stumps you, you can get answered here or possibly in the docs.
I had to learn all of the torque engines from the ground up. That's what I did. You should start simple with a shooter. Let me know if you need any more advice on where to start.
#6
Torque is definetly capable you can almost make pacman within the editor with the behaviors that come with the engine alone. Just do a quick look up on how the ai was created which can be easily done with a case statement and there you go you meet your pacman accomplishment in no time. Utilize the resource art and and some shape vectors to create the level and you'll be in business in no time. I use shape vectors to prototype levels all the time.
02/12/2012 (6:40 pm)
Had to make all those games in college with javascript bleh. >_< Torque is definetly capable you can almost make pacman within the editor with the behaviors that come with the engine alone. Just do a quick look up on how the ai was created which can be easily done with a case statement and there you go you meet your pacman accomplishment in no time. Utilize the resource art and and some shape vectors to create the level and you'll be in business in no time. I use shape vectors to prototype levels all the time.
Associate redmasqu3rad3
GarageGames
But for your "Do I:" section, you will always want to create a new scene/screen for all of those. Every new level will be a scene, same with credits, menus, splash screen, highscores, and anything else you want to put in your game. Then for code, you will need to make a code file for the player. Only 1 for the enemies, once you have 1 enemy doing what you want, you just have the other enemy images call the script so they will perform the same way. For the last one, it depends on how you program your player, some of the code can be contained within their code and others will have to have their own file.