Jump to content

Player Movement with Physics not working! HELP


Raagh
 Share

Recommended Posts

Hey guys, so probably I am doing tons of things wrong, but i cant get to move my characters( with the physics enabled) . if i change the position for the sprite of course it works. but doing it by velocity it doesnt.

Those someone mind checking my code?

Particularly the play state in src/states/play.js and the player sprite in src/sprites/player.js

https://github.com/Raagh/a-game-needs-no-name

to run the game do 

npm install

npm run web

Thanks. I will post here if i do some progress.

 

 

Link to comment
Share on other sites

1 hour ago, Madclaws said:

did u check "player.body.velocity.x"

ýeah i tried velocity and it didnt work. neither poisition( pretty sure its because I am working with the player class not actually with the sprite that game.add.sprite() returns) but I am confused on how this should be done using es6

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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