Page 1 of 1

snake game

PostPosted: Fri Jul 29, 2005 5:06 pm
by ntware
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

PostPosted: Sat Jul 30, 2005 6:38 am
by jazz_e_bob
Hmmmm

We need a snake demo...

PostPosted: Sat Jul 30, 2005 10:12 pm
by ntware
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:

PostPosted: Sat Jul 30, 2005 10:43 pm
by Game A Gogo
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

PostPosted: Sun Jul 31, 2005 2:46 am
by ntware
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

PostPosted: Sun Jul 31, 2005 1:43 pm
by Game A Gogo
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

PostPosted: Sun Jul 31, 2005 3:04 pm
by jazz_e_bob
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!

PostPosted: Mon Aug 01, 2005 8:32 pm
by ntware
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!

PostPosted: Wed Aug 03, 2005 4:32 pm
by ntware
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?

PostPosted: Wed Aug 03, 2005 5:25 pm
by makslane
Use the "Event Disable" action to disable the key down events