Page 1 of 1

Platform Location Relative to Viewport

Posted: Thu Mar 05, 2009 11:38 am
by justindz
I'm learning more Chipmunk and making more progress on a basic platformer. I started from a birds-eye RPG scrolling tile engine, so currently I have the viewport tracking the player's movement. However, when I add platforms and give them coordinates, I find that as the viewport moves, the player is landing on where the platforms are relative to the viewport rather than relative to the "world."

Has anyone dealt with this? Any advice? I assume that moving around the platforms as the viewport moves is probably a horrible idea, if even possible. I also thought about adjusting for the viewport in the collision detection callback and ignoring if it doesn't check out, but that's probably highly inefficient, if even possible. I can pastie the code if it would be useful. The viewport and tile logic is pretty standard as far as tile-based scrolling game logic goes. Appreciate your wisdom!

Re: Platform Location Relative to Viewport

Posted: Thu Mar 12, 2009 8:47 am
by sksmith
Hi Friend,

Is there any version of PointInRect like in chipmunk. How do we know if a ball is inside a rectangle or another shape?
Thanks