Forums

OverviewV-Play 1 SupportPlatform Game, with large worlds › Reply To: Platform Game, with large worlds

OverviewV-Play 1 SupportPlatform Game, with large worlds › Reply To: Platform Game, with large worlds
#7984

Alex
V-Play Team

Hi,

in fact, only the debug draw is wrong, the colliders are in the right place, else the player would not land on the platforms. The reason for this is that the PhysicsWorld item is outside of the level, which is moving. What the Physicsworld does, is using the position of the physical bodys relative to their parent (level) and draw them, unfortunately, relative to itself (by default, the PhysicsWorld fills it’s parent, which is the scene). Now that the level is moving, but the physical bodys are not (at least not relative to their parent) they are drawn incorrect by the PhysicsWorld.

It’s sometimes a little bit displeasing, that the debug draw is decoupled from the actual physics, as seen in this case…

If you need correct debug draw, you need to put the PhysicsWorld inside the level item. Furthermore you will have to change the level itself a little bit because in this little demo, it has no actual width and height. We just make use of its 0|0 origin and add blocks and the player relative (as children) to it. Also we are placing the blocks in negative y-direction, which means just setting a height to the level item won’t do the job, because the item will then grow in positive y direction while the blocks are in fact in negative y-direction.

Long story short, that’s not really a bug, instead my cloud-platform-centered-camera-example is quite poorly designed to work with the debug rendering of the PhysicsWorld :(

I hope this explanation was good enough for you to implement it better than i did 😉

Cheers,
Alex

  • This reply was modified 4 years ago by  Alex.
  • This reply was modified 4 years ago by  Alex.
  • This reply was modified 4 years ago by  Alex.
  • This reply was modified 4 years ago by  Alex.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support