Jump to content

Just started with PhaserJS, setting velocity.y but my sprite isn't moving!


jg7183
 Share

Recommended Posts

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(){			}

post-9032-0-46041200-1401927496.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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