12-29-2013, 04:16 AM
Hello everyone! I'm trying to implement a funny version of the snake game posted on youtube by brandonioproduction , and I'm kind of stucked. The idea is to make the snake wobble after eating some fruits ( that in the end will be changed to beers <!-- s --><img src="{SMILIES_PATH}/icon_e_wink.gif" alt="" title="Wink" /><!-- s --> )
so by the move() when the snake is going direction.NORTH for example , the coordinates are (head.x , head.y -1) so it goes straight up.
I have to implement something that changes the head.x like this:
case Direction.NORTH:
newPoint = new Point(head.x -1, head.y - 1);
then
newPoint = new Point(head.x +1, head.y - 1);
then
newPoint = new Point(head.x -1, head.y - 1);
then
newPoint = new Point(head.x +1, head.y - 1);
so you get the idea here. The snake would zigzag in x axis when moving vertically. and of course also would zigzag in the y axis when going horizontally.
Any Ideas are very welcome !!
cheers!
so by the move() when the snake is going direction.NORTH for example , the coordinates are (head.x , head.y -1) so it goes straight up.
I have to implement something that changes the head.x like this:
case Direction.NORTH:
newPoint = new Point(head.x -1, head.y - 1);
then
newPoint = new Point(head.x +1, head.y - 1);
then
newPoint = new Point(head.x -1, head.y - 1);
then
newPoint = new Point(head.x +1, head.y - 1);
so you get the idea here. The snake would zigzag in x axis when moving vertically. and of course also would zigzag in the y axis when going horizontally.
Any Ideas are very welcome !!
cheers!