-
"snake"
I'm making a game like "snake" but I need some serious help.
I can't figure out how to make it so the "snake" can't double back on itself.
And I can't figure out how to make it start going in a random direction (left, right, up, down) upon starting the game where the snake starts at a constant speed (say 30).
Right now I start the game and the snake is not moving until I press an arrow key.
Also, this might just be because I'm so tired but I need help figuring out how to make an object randomly appear (only 1) in the game then the "snake" eats it and grows 1 section bigger and as soon as it is eaten, a new one appears at another random spot. help?
How can I make it so the "snake" head moves, then the body follows that path?
-
Re: "snake"
please help, i'm on a deadline....
-
Re: "snake"
Just put if he collides with himself die. :)
IF: ("Snake") Colides with ("Snake")
ACT: restart game or something like that. :)
-
Re: "snake"
I think he means to that you can't go strait from left to right or up to down....
Use this as a example event.
If key down left arrow and not facing direction right then set direction left.
... If you can't manage private message me and I'll make you an example.
-
Re: "snake"
I got the movement down... now i'm having trouble adding the different segments to the snake when it eats the block. help?
-
Re: "snake"
hm..... now thats a thinker...
-
Re: "snake"
-
Re: "snake"
-
Re: "snake"
snake hits block:
destroy block
make new block (your code)
+1 to Alterable Value A of Snake
New event: Number of snake body things less than alterable value a
create snake body part
always
add 1 to alterable value a of snake body
alterable value a of snake body greater than 10
destroy snake body
you can think of how to implement it properly and work on it :)
-
Re: "snake"
Hmm - this sounds familliar :)
Here is my snakes example - hopefully it is of some help to you.
http://www.clickteam.com/eng/resources/open_source/Snakes.zip
-
Re: "snake"
Here is my example of a snakes movement, in this version the segments actually follow the snake so its a bit nicer to look at.
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=94439#Post94439