Jump to content

Asteroids Game Like Physics


NotKawaiiGirl
 Share

Recommended Posts

Hello!

I'm working in a game that use physics like asteroids, the arcades game, but i'm having trouble making "the ship" to move. I'm using whatever sprites I found for testing, so right now the ship is the guy from the first official tutorial in the page of Phaser 3.

TL;DR How do I use velocityFromRotation() work for my sprite. I've read the documentation but I just don't get it. Thank you, btw.

I put here the code. For now, "the ship" is called "dude".

 

game.js

Edited by NotKawaiiGirl
I uploaded the wrong file
Link to comment
Share on other sites

Thank you very much! Now i've the movement i wanted.

Now I'm having trouble with socket.io, because when I get information from the server and want to use it to create sprites/images I don't know how to do it. I'm not sure about how the scenes work and when i try to use this.physics.add.sprite outsite of preload-create-update it says there is not such thing. I'm attaching the server and client files in this post. If anyone can suggest a way of creating the sprites/images outside the basic scenes (So i can use the data obtained from the server) I would really appreciate. THANK YOU!

game.js

server.js

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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