|
-
Ryan Kallok: Kallok Studios
im interested in making a simple game like the one located at http://www.entropicorder.com/games/cupcake.swf
All that i am interested in making is a game where u can move a character and can run into obsticles like in it.Is there a tutorial or fla somewhere that can help?Or if you got one and wanna send me it email me at [email protected]!
-
Well, I can't think of any tutorials for that sorta thing (other than the spaceship tute in the Games Tutorials section)
I suggest downloading that, cause it deals with alot of the principles exercised in "Cupcapades"
Basically, you need only a couple things
1. A character
Which will be moved using code like this:
Code:
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
this._x+3;
} else if (Key.isDown (Key.LEFT)) {
this._x-3;
}
}
2. Obstacles (the logs in Cupcapades)
the code that goes here could vary, but something like, a hitTest with the Log and the character which would cause the character to "die". (you'll also need code to move the logs along similiar to the character, this is a bit in depth, so if you need more help, I'll post more on this and maybe creat a tutorial/sourcefile for you to pick apart)
3. A score counter, very simple. You create a blank text field, change it to Dynamic Text, and call it something like "score"
In the keyframe of the main timeline that contains the game, add this bit of code:
[code_root.score = 0[/code]
(this starts the score out at zero)
Now each time the obstacle reaches the left side of the screen it disappears (more advanced code to duplicate and remove the logs, but I'll explain more later) and makes the score go up by 10.
Code:
onClipEvent (enterFrame) {
if (_root.log._x == -143) {
_root.score += 1;
}
}
Obviously there is a bit more to this game's source code, but this gives you an idea of how the game works basically.
I highly recommend searching the Games Tutes, cause there's a really good one there that has this sorta stuff covered. it's more advanced but with some determination you should be able to pick it apart (I was )
Post some more if you want me to explain some more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|