I'm writing a side scrolling game with physics. Before get my hands dirty i started concentrating on physics and rendering graphics. Initially i thought of keeping every thing static (non scrolling). For physics after referring to many tutorial finally i ended up here http://www.tonypa.pri.ee/vectors/tut08.html. This set of tutorial covers most of the basic/advanced physics required for simple game. By following this tutorial i have created my 2d world with objects like triangle , box ,..... Each different objects vertices are saved as vectors for calculating the collision,bounce , ....... Response is pretty good if i apply force in x/y , is working perfect as long as each collidable objects are static. now im struggling in how to move all the vectors according to the direction (right/left) and at the same time updating the new change in vector for collision. i have some basic understanding how this translation works in tile based environment. But for the non tile based world what is the best practice. Thanks in advance.
Im trying to scroll the whole scene in both x,y. It would be great if some one explain the approach behind the PSP popular game LOCO ROCO. Online version is here http://www.cuteflashgames.com/game/loco_roco.html
If you're going to move everything, the best way would be just to scroll the virtual camera.
I'm afraid I don't know anything about flash, but I would assume it has some functionality to manipulate the virtual camera, default transform matrix or something similar.
You shouldn't need to change anything else if you can manipulate the virtual camera or default transform matrix.
Thanks for your reply.Im not developing this in flash , writing this game in objective-c/c for iphone using cocos2d and my own vector based physics. As you said i have tried scrolling the whole CCLayer but i couldn't make it perfect smooth.I will try exploring the camera and openGL ES. Can someone explain how the x,y coordinate of the camera should translate respective to player movement?
If you're using OpenGL...
I'm sating this from memory so you need to check exacts, but I think there is an GL method that stats the location and what you are looking at. That is all you have to do. You can specify it in world co-ords so the x,y co-ords of the respective objects dont change, just your veiw does.