Jump to content

Sprites pushing each other and jumping


head
 Share

Recommended Posts

Hey guys, hope you're having a great time.

 

And I have a little problem you may be able to help me with.

I'm making sort of RTS and there are lots of units marching to each other and killing each other.

The problem is, they are stepping onto each other, and kind of pushing each other, and sometimes even jumping someplaces. This looks weird.

Watch this video and you will understand what I'm talking about (I'm using Warcraft 2 sprites just for testing purposes, and also because they are great).

https://www.youtube.com/watch?v=6htpVG8Shyc

A little more details:

I'm using Arcade physics.

All units are objects of the same class, derived from Phaser.Sprite.

All of them have a circle body, anchor set to 0.5 (if if matters), and are moving using velocity (before that I was modifying their poistions manually but with the same result).

Units belong to 2 different groups, each group is collided with self and other group - so they won't walk through each other.

 

What I want is that units would be standing still and no one could move them, not to mention these weird jumps.

Is there some common techinque for handling this, do I miss something?

 

Thank you in advance.

 

 

 

 

Link to comment
Share on other sites

I'm beginning to think I'm gonna have to switch to square bodies and then check for 'touches' property, if unit is touching something then stop its velocity in that direction.

The 'touches' property doesn't seem to be working with round bodies, which is understandable.

However I thought using round bodies would give a more natural unit positioning.

Any thoughts, anyone?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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