jg7183 Posted June 5, 2014 Share Posted June 5, 2014 Hey guys jg here, So I recently stumbled across PhaserJS and found some cool youtube tutorial videos and documentation online. I've managed to display my sprite on the canvas. I wanted to get it to drop down so I set the sprites velocity.y = 100; But it's not moving. Can someone tell me what's wrong with my code? var star;var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });function preload(){ game.load.image('star','star.jpg'); } function create(){ star = game.add.sprite(game.world.centerX,0,'star'); star.velocity.y = 100; } function update(){ } Link to comment Share on other sites More sharing options...
rich Posted June 5, 2014 Share Posted June 5, 2014 I think you may have been following a pretty old tutorial or something. Have a look at http://examples.phaser.io - specifically the Arcade Physics section, and you'll see how to set-up a move an object using the current version. TomFiveThumbs 1 Link to comment Share on other sites More sharing options...
Recommended Posts