How Can I Turn This Javascript Code Into Phaser Code? -
if(mouse.x && mouse.y) { mygameball.x = mouse.x; mygameball.y = mouse.y; }
how can turn javascript code phaser code?
you can use game.input
, this
create = function() { // .. this.game.input.addmovecallback(this.domygamemousemove, this); } domygamemousemove = function(evt) { if (evt.isdown) { mygameball.x = evt.x; mygameball.y = evt.y; } }
Comments
Post a Comment