Skip to content
Snippets Groups Projects
Commit 895605c8 authored by Samson's avatar Samson
Browse files

jorma

parent 4e5fc875
No related branches found
No related tags found
No related merge requests found
Pipeline #162750 passed
harkka3/samson/assets/sprites/penis.png

2.83 KiB

var demo = {};
var demo = {}, centerX = 1500/2, centerY = 1000/2, jorma, speed = 4;
demo.state0 = function(){};
demo.state0.prototype = {
preload: function(){},
preload: function(){
game.load.image('jorma','assets/sprites/penis.png');
},
create: function(){
game.stage.backgroundColor = '#ffcccc';
console.log('state0');
addChangeStateEventListeners();
game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
jorma = game.add.sprite(centerX, centerY, 'jorma');
jorma.anchor.setTo(0.5, 0.5);
},
update: function(){}
update: function(){
if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
jorma.x += speed;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
jorma.x -= speed;
}
if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {
jorma.y += speed;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
jorma.y -= speed;
}
}
}
function changeState(i, stateNum){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment