Skip to content

ourcade/phaser3-sword-rotation-arcade-physics

Repository files navigation

Rotate a Sword with Arcade Physics in Phaser 3 Example

A potential solution for Arcade Physics body that do not rotate with GameObject

License

Watch on YouTube

You can watch how this example was created here: https://www.youtube.com/watch?v=akgFNu60Kv4

Some code clean-up was added after the video ended that shows how it can work in both scenarios of having the circle physics body as part of the Container or as part of the Scene.

You can toggle the different cases in SwordContainer.ts by changing containPhysicsObject.

Motivation

This is a potential solution to a problem discussed on the Phaser Discourse: https://phaser.discourse.group/t/workaround-for-rotation-on-arcade-physics/5763/6

Demo: https://ourcade.github.io/phaser3-sword-rotation-arcade-physics/

Prerequisites

This example project uses the phaser3-parcel-template and requires Parcel.

Getting Started

npm install
npm run start

Running at http://localhost:8000

Assets

The sword graphic used in this example is by Kenney.nl.

License

MIT License

About

Potential solution for Arcade Physics body that do not rotate with GameObject

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published