Jump to content

Phaser Arcade Physics - Tips & Tricks?


LTNGames
 Share

Recommended Posts

I finally got my test game all setup the way I want it to be and I can finally start playing with the physics options, well, I did just that and I am getting strange behavior all around, I'm really unsure why these things happen or how to avoid them. I'm really unsure because there is not much information on how the physics system works, I've looked at the API docs and it tells me how to get them working but not quite how they work and what options should be mandatory, etc. So, I figured I'd ask the community for some tips and tricks to get things running smoothly, what to watch out for, how to check certain things etc. I'll ask a feqw questions to get it started and who knows maybe there is an old tutorial or guide explaining the many things available with Arcade physics.

Questions & Issues:

Note: My objects are in a group, not sure if this changes the physics in anyway but I figured I'd mention it. 

1. Firs things first, I noticed my objects on my map are affected by my global gravity but for some odd reason when they collide with my player, they go very far and keep sliding without stopping lol WTH! did I just do? How would I go about fixing this problem?

2. I decided to set the objects on my map to have their own local gravity, the moment I did this though they stopped colliding properly with my tilemap and are sunk into it a little bit, this also seemed to fix my collision with the player making them go very far without stopping lol Not quite what I was looking for though. Any information on this would be nice.

3.  Is this normal behaviour for physics boundary boxes? They objects(boxes) bounds seem to follow the camera up and down

normalPhysics.gif

4. Can you check if a sprite is colliding with "anything on the map", rather than inputting each one. For example I have my player able to jump and a lot of my flags are checking if the body is on the floor, I would like to be able to check if the player is on top of anything collidable not just the floor because if my player is sitting on top of a box the jump animation continues to play and I can't jump anymore because I had it setup to check if it was on the floor before jumping not if it was colliding with a box. I'm sure I can figure out another workaround but it would be nice to hear what the community has to say.

That is all the question for now, I'll continue playing with the settings and reading the API and report back any questions I may have. Thanks in advanced!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...