Jump to content

[Plugin] Arcade Circles


VitaZheltyakov
 Share

Recommended Posts

I finally finished writing the Phaser Arcade Circles plugin.

Plugin on GitHub:

https://github.com/VitaZheltyakov/phaser-arcade-circles-plugin

 

This plugin adds to framework:

  • Circle vs. Circle collision
  • Circle vs. Rectangle collision
  • Circle-body debug render

The plugin does not reduce the performance of arcade physics. The plugin is easy to use. It does not add new functions, but merely extends existing.

How to add a plugin:

Add to your index.html link to plugin file:

<script src="js/phaser-arcade-circles-plugin.js" type="text/javascript"></script>

How to use a plugin:

Then use the standard function setCircle for the circle-body.

sprite1.body.setCircle(radius, offsetX, offsetY);

Calculation of the collision produced as usual. No further use is not necessary functions.

Note:

  • Remember, this is an arcade physics. Not real physics. Therefore, some collisions may seem strange.
  • Remember, that the setCircle function overrides scaling and anchor point.

 

Examples:

The repository has 4 examples of using the plugin.

---

If Rachard read this post

Richard, I recommend you to add this functionality in the Phaser.

Link to comment
Share on other sites

13 hours ago, hexus said:

Sweet plugin!

As far as I'm aware, circle body support is being worked on already for newer versions. Check the branches of Phaser's Github repo.

Yes, it is being developed. I hope in the next version it will work.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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