Platform Location Relative to Viewport

Official forum for the Chipmunk2D Physics Library.
Post Reply
justindz
Posts: 3
Joined: Mon Mar 02, 2009 10:43 am
Contact:

Platform Location Relative to Viewport

Post 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!
sksmith
Posts: 2
Joined: Thu Mar 12, 2009 8:38 am
Contact:

Re: Platform Location Relative to Viewport

Post 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
[url=http://www.mag-corp.com/mag_services_offshore.asp]Offshore Software Development[/url]|[url=http://www.mag-corp.com/mag_services_custom.asp]Custom Software Development[/url]|[url=http://www.mag-corp.com/mag_services_itoutsourcing.asp]Software Outsourcing[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests