Hi all !
I’m new, I come from php and have already done a web browser game, and now I code in java for android, and I’m making my first game on android/java from scratch (no framework, I know, I’m mad!)
I know the theory of collision detection with Rectangles
But here is a problem for me:
The game : the hero can only jump, like https://play.google.com/store/apps/details?id=com.andoop.freerunning
The world : is scrolling to the left with obstacle to jump above
For my question I set for example this:
Integer world_speed = 50; // in pixel
Integer block_height = 32; // in pixel
Integer block_width = 32; // in pixel
so, each frame the world will draw 50 pixel to the left (the world is scrolling to the left)
http://img15.hostingpics.net/pics/613354questionjavagaming.jpg
THE QUESTION :
How to detect collision in the case of a infinite scrolling world between blocks and hero when the world is scrolling left with N pixels for each frames?
Best regards and thanks for having reading this