Advice on general approaches or feasibility and discussions about game design
by Tiash » Sun Jul 20, 2014 5:15 pm
Last week, i have fork
Snake by Ripper121 for do a version that uses a list instead an array, for find a more efficient version of the same game.
But i have a bug: when the snake hits a food, it stops running.
I think that problem is in the function "next_step()" after it's test "hitFood()"
Code: Select all void next_step() { //Controllo se mangia if (hitFood()) { insertBody(); score = score + point; nextFood(); } else { insertBody(); removeBody(); } }
I do not understand what causes the problem.
Can anyone help me?
How can i debug it?
Here the code
Tiash
Posts: 18Joined: Sat Jul 12, 2014 7:28 amLocation: Italy
by Tiash » Sun Jul 20, 2014 7:35 pm
I have find the problem!
I was wrong to implement the function "removeBody"
I have find a inefficiency too, that in the next days i will fix
The code is now update! (and working too)
Tiash
Posts: 18Joined: Sat Jul 12, 2014 7:28 amLocation: Italy
by ripper121 » Sun Jul 20, 2014 8:23 pm
Nice to see first mods
ripper121
Posts: 224Joined: Fri Apr 04, 2014 2:02 pmLocation: Germany
by ripper121 » Mon Jul 21, 2014 12:37 pm
What are this crosses? If you like you can Post the game in the Snake thread or i can include it in the Main post as a Mod.
ripper121
Posts: 224Joined: Fri Apr 04, 2014 2:02 pmLocation: Germany
by Tiash » Mon Jul 21, 2014 12:42 pm
ripper121 wrote: What are this crosses?
The crosses indicate where the snake has eaten something.
ripper121 wrote: If you like you can Post the game in the Snake thread or i can include it in the Main post as a Mod.
First i want to implement some ideas. When I am satisfied, I will add
Tiash
Posts: 18Joined: Sat Jul 12, 2014 7:28 amLocation: Italy
by ripper121 » Mon Jul 21, 2014 1:51 pm
snake[1].jpg (64.3 KiB) Viewed 5362 times
This is a screenshot from the Nokia Snake 2, you can see the bigger part which is your cross.
It would be nice to see such graphics
ripper121
Posts: 224Joined: Fri Apr 04, 2014 2:02 pmLocation: Germany
by rodot » Mon Jul 21, 2014 3:22 pm
This topic reminds me of a snake game I made on a very, very early prototype of the Gamebuino
VIDEO
rodot
Site Admin
Posts: 1290Joined: Mon Nov 19, 2012 11:54 pmLocation: France
Return to Project Guidance & Game development
Who is online
Users browsing this forum: No registered users and 6 guests