snake game

Talk about making games.

snake game

Postby ntware » Fri Jul 29, 2005 5:06 pm

Hellow guys! I'm trying to make a snake game just to get some experience with this new tool that seems to be very nice for programming to pocket pc's. Well, the thing is that I'm trying to make a "snake moviment" to the game, that's smoother than the normal 90 degress movement that we learn on basic tutorial. what i need is that when u press, for example, the right button, just the "head" of the snake turn right and then, as it "walk", the rest of the body fallow the head. I don't have any idea how I can do this. The movimentation that I made is just a simple "all body 90 degress" and it's absolutly terrible for a snake game. Someone have a great idea, pliiiz?!?? ehehe..thankx
User avatar
ntware
 
Posts: 14
Joined: Fri Jul 29, 2005 4:51 pm
Score: 0 Give a positive score

Postby jazz_e_bob » Sat Jul 30, 2005 6:38 am

Hmmmm

We need a snake demo...
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ntware » Sat Jul 30, 2005 10:12 pm

yes...it's really hard to make the snake moviment in GE. I can't believe that anybody know yet a way to do this. :shock: I'm finishing my game without the smooth moviment, and as expected, it's going terrible!!! I'm still trying to find how can, after the snake "eat" all the apples, it go to next level. Probally will need an "if" or "when" statement on the scrip, but I don't know yet how to use none of them. If somebody have an idea, I will be very gratefull.... :roll:


See ya friends... :wink:
User avatar
ntware
 
Posts: 14
Joined: Fri Jul 29, 2005 4:51 pm
Score: 0 Give a positive score

Postby Game A Gogo » Sat Jul 30, 2005 10:43 pm

Just make the snake animation of tuning left, right and walking left, right (Might be hard), then do these

-Path finish(left)-change animation(T_Right)
-animation finish(T_Right)-change animation(Right)
-animation finish(T_Right)-changepath(Right)
-Path finish(Right)-change animation(T_Left)
-animation finish(T_Left)-change animation(Left)
-animation finish(T_Left)-changepath(Left)

The animation start with (Left) and the path start with (left)

Maybe this is not what your looking for.

Note:
This is only for an enemy
and dont forget to do the path
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby ntware » Sun Jul 31, 2005 2:46 am

thankx a lot Game_a_Gogo (nice nick...hehehe :wink: ) but the thing is, I really can do the animations without a big problem, but, how to know if the snake is coming to left from down, up or right?!? that's THE question, u know!! because depending of the last direction of the snake, it will need a diferent animation to turn "left", for example, u got it? I'm really thinking HARD to solve this problem, and if have some friends that could help me, will be great!! thankx a lot folks
User avatar
ntware
 
Posts: 14
Joined: Fri Jul 29, 2005 4:51 pm
Score: 0 Give a positive score

Postby Game A Gogo » Sun Jul 31, 2005 1:43 pm

OH... I tought that your where making a side scroling game then folow these:

-Path Finish(Up)-change animation(T_left)
-animation finish(T_left)-Change path(Left)

That is for turning left while going up.

if you want to do the others you will have to change the tings in the "(" ")".
and this time there is 8 animation for turning and 4 for walking

NOTE:
THIS IS ONLY FOR ENEMIES.

if you want to move the actor with the KeyBoard, it will be realy harder.

(nice nick...hehehe javascript:emoticon(':wink:')
Wink )


Tanks
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby jazz_e_bob » Sun Jul 31, 2005 3:04 pm

ntware wrote:thankx a lot Game_a_Gogo (nice nick...hehehe :wink: ) but the thing is, I really can do the animations without a big problem, but, how to know if the snake is coming to left from down, up or right?!? that's THE question, u know!! because depending of the last direction of the snake, it will need a diferent animation to turn "left", for example, u got it? I'm really thinking HARD to solve this problem, and if have some friends that could help me, will be great!! thankx a lot folks


Make 2 variables:

directionOld
directionNew

on keypress
update directionNew
compare directionNew to directionOld
if ( directionOld = N AND directionNew = E )
change to right bend animation
else if ( ( directionOld = N AND directionNew = W )
else... (continue for EVERY case )
directionOld = directionNew


Hope this helps. I want to play!
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby ntware » Mon Aug 01, 2005 8:32 pm

thankx a friends! It's helping a lot, but I'm still trying to work with the C language script. Look what's still done in my begining game job. I put the game on internet at this link: http://geocities.com/suporte_ntware/snake.zip

see what I'm trying to do, so it will be easier to you help me! Ah, I'm trying to find too how can I jump to another level, when the snake eats all the apples (I'm using clones on apples).


See ya!
User avatar
ntware
 
Posts: 14
Joined: Fri Jul 29, 2005 4:51 pm
Score: 0 Give a positive score

Postby ntware » Wed Aug 03, 2005 4:32 pm

my snake game is almost done! I made everything diferent and now it looks much better! I just need to find how can I destroy my actor when it colides with the wall with animation. If I put the animation and do "destroy actor" with imediate action, the actor is destroyed before the animation starts, or at the first frame of the animation. If I put to it wait until the animation ends, the player still can move the actor even if it's teorically "dead". Have I way to I lock the actor and disable all the funcions relative to the actor when it colides and play the animation?
User avatar
ntware
 
Posts: 14
Joined: Fri Jul 29, 2005 4:51 pm
Score: 0 Give a positive score

Postby makslane » Wed Aug 03, 2005 5:25 pm

Use the "Event Disable" action to disable the key down events
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest