226
General / Re: [SFML 2.1] Sprite animation not playing
« on: December 09, 2014, 05:16:57 pm »
This might be another case where the code you provided isn't really enough to go off of. You said you can move in the y-axis easily, but can you move both up and down without problem? Based off of what you provided, all I can really say is that if currentx*32 or currenty*32 ever get less than the animated sprite's position, you won't be able to move because great_x or great_y will be false.
My suggestion would be to just add a bunch of prints to your code to make sure your variables are what you expect them to be. Alternatively, you can learn how to use a debugger (if you aren't familiar with one already) to step through your program and look for logic errors. Perhaps you could also search the internet or these forums for resources on tile based movement. For example, maybe you can get some ideas from this thread:
http://en.sfml-dev.org/forums/index.php?topic=9639
My suggestion would be to just add a bunch of prints to your code to make sure your variables are what you expect them to be. Alternatively, you can learn how to use a debugger (if you aren't familiar with one already) to step through your program and look for logic errors. Perhaps you could also search the internet or these forums for resources on tile based movement. For example, maybe you can get some ideas from this thread:
http://en.sfml-dev.org/forums/index.php?topic=9639