Hey folks!
New to the forum, and so far I am loving SFML (though I am not sure if I am utilizing it well, yet).
In order to try to teach myself c++ and SFML, I began a small snake game, and I am hoping some people might be willing to check out the code and let me know what I can do to clean it up so far.
So far it is just the snake's head moving around the screen and dying when it hits the walls.
But I am sure that some of the code could be cleaned up. Especially in my Move_Me() SnakeHead member function such as this line:
this->SetPosition( (game.SW - this->GetImage()->GetWidth()), this->GetPosition().y );
I am wondering if there is an easier way to access my sprite's width, screen width, etc...
Anyway, here is the zip of my Code::Blocks project.
http://bglz.net/files/cpp/projects/Yellow_Snake.zipMy code, though crappy as it probably is, is always free to use, reuse, and distribute at your pleasure!
Thanks!
Brock