I recently made a game and uploaded it (here it is). It's called Extreme Snake (but doesn't have much to do with Snake, just see the project notes for details).
Anyway, I have a couple of problems...
Problem 1: Music
I can't find any music that actually fits the game. I know loads of people use rave-like dance music from Newgrounds, but that's not what I want. I want music that actually fits the game, so if you could help that would be excellent (it can be from Newgrounds, but not the music I described)...
Problem 2: Losing lives if you hit yourself
I want to make it so that snake loses a life if it hits its own trail. But the problem is that it's always touching its trail because it uses a stamping mechanism, so I can't just do this:
if <touching color []> change [lives] by [-1]
So what do I do?
Any help is appreciated...
Offline
I've made some attempts at snake games before, and I've run into similar problems. I assume you're using lists for the snake's position. I've found that if you store both the x and y positions in one list item, you can keep the position of the snakes "head" in a separate variable and use a script like this:
if list [snake_positions] contains [head_position] broadcast [dedz] EndIf
Offline
move forward (length of head) steps if <touching color []> change [lives] by [-1] move forward (negative length of head) steps
Now the head is one space ahead of where it should be stamping. It will now only render your collision as true if you're heading into your trail. Then it goes back to where it was.
For better results (and to ensure no glitches), maybe make it 1 pixel faster than the length of the head.
Last edited by Kileymeister (2011-03-13 12:33:00)
Offline
What kileymeister suggested should work, but it's very laggy and unprofessional.
I would add a second sprite which is always slightly ahead of the snake, and senses the color there instead.
Offline