I have done the snek game upto the tutorial 14a. I tried debugging the code but couldn't get any solution. When i run the program, the screen just goes white. The snek game is not fully complete, but it's upto the point where you can actually move the snake and make it grow. here's the repository:
https://github.com/Sheriff40/GitSnek
thank you!!
Snek Game
Re: Snek Game
Welcome to PlanetChili. And to programming
I took a look at your code.
I am new to programming too so ya know still might not work
But i found a couple error in your typography
One more
I took a look at your code.
I am new to programming too so ya know still might not work
But i found a couple error in your typography
Code: Select all
// Snake.cpp
//In your Snake::Segment::InitHead()
Color c = HeadColor;
// Should be
c = HeadColor;
// And in your Snake::Draw()
for ( int i = 0; i < MaxSegments; i++)
// When you first draw your snake you dont have all of the segments location and color set up
// Should be
for (int i = 0; i < nsegments; i++)
Code: Select all
//Location.h
//Location::Add()
//You are just setting the x and y to val.x and val.y
x = val.x;
y = val.y;
// Should be
x += val.x;
y += val.y;
Re: Snek Game
Seems like you had a few problems there. Thanks to james for sussing that stuff out!
Try these fixes first and see if that solves your shit. Otherwise update your repo and we'll take another look. Good job posting github btw, that's how you get help.
Try these fixes first and see if that solves your shit. Otherwise update your repo and we'll take another look. Good job posting github btw, that's how you get help.
Chili