views:

49

answers:

4

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.

A: 

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

Anandh
I realize that you have since put these into comments, which is the way to go, but you might want to delete them. They rub some people on here quite the wrong way and it might drive people away from your question.
Justin Peel
You are rite. i realized off late and moved but at the same time I couldn't find any delete button on the screen. .May i know where to go for deleting ?
Anandh
A: 

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.

Montdidier
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?
Anandh
I'm familar with OpenGL but not OpenGL ES so I don't know where exactly they vary. In opengl you'd set glMatrixMode(GL_MODELVIEW) in order to manipulate the model view matrix and then use either glTranslatef or use the glLoadMatrixf methods (and maintain your own view matrix outside of opengl) to manipulate the virtual camera. I normally maintain my own matrices as it's easier to get access to all the data you need in a complex program.
Montdidier
A: 

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?

Anandh
A: 

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.

TAkinremi