diff --git a/asset/sprites/rocket01.png b/asset/sprites/rocket01.png new file mode 100644 index 0000000..6efa7f9 Binary files /dev/null and b/asset/sprites/rocket01.png differ diff --git a/asset/src/rocket01.xcf b/asset/src/rocket01.xcf new file mode 100644 index 0000000..b1c728c Binary files /dev/null and b/asset/src/rocket01.xcf differ diff --git a/data/sprites.json b/data/sprites.json index 622fff6..b05fa20 100644 --- a/data/sprites.json +++ b/data/sprites.json @@ -1 +1 @@ -{"astronaut":{"sx":0,"sy":1,"cols":1,"tilew":24,"tileh":24,"frames":1},"minecraft-cake":{"sx":0,"sy":26,"cols":1,"tilew":32,"tileh":32,"frames":1},"neingeist":{"sx":0,"sy":59,"cols":1,"tilew":24,"tileh":24,"frames":1},"starbug":{"sx":0,"sy":84,"cols":1,"tilew":24,"tileh":24,"frames":1}} \ No newline at end of file +{"astronaut":{"sx":0,"sy":1,"cols":1,"tilew":24,"tileh":24,"frames":1},"minecraft-cake":{"sx":0,"sy":26,"cols":1,"tilew":32,"tileh":32,"frames":1},"neingeist":{"sx":0,"sy":59,"cols":1,"tilew":24,"tileh":24,"frames":1},"rocket":{"sx":0,"sy":84,"cols":1,"tilew":26,"tileh":52,"frames":1},"starbug":{"sx":0,"sy":137,"cols":1,"tilew":24,"tileh":24,"frames":1}} \ No newline at end of file diff --git a/images/sprites.png b/images/sprites.png index c6c11b4..b420748 100644 Binary files a/images/sprites.png and b/images/sprites.png differ diff --git a/platformer.js b/platformer.js index 7c54f12..9058242 100644 --- a/platformer.js +++ b/platformer.js @@ -47,11 +47,11 @@ Q.Sprite.extend("Player",{ // hit.sprite is called everytime the player collides with a sprite this.on("hit.sprite",function(collision) { - // Check the collision, if it's the cake, you win! - if(collision.obj.isA("Cake")) { + // Check the collision, if it's the rocket, you win! + if(collision.obj.isA("Rocket")) { this.destroy(); - $( "#einladung" ).show( "slow" ); - Q.stageScene("ThereWillBeCake",1, { label: "You Won!" }); + $("#einladung").center(); + $("#einladung").show("slow"); } }); @@ -60,9 +60,9 @@ Q.Sprite.extend("Player",{ }); -Q.Sprite.extend("Cake", { +Q.Sprite.extend("Rocket", { init: function(p) { - this._super(p, { sheet: 'minecraft-cake' }); + this._super(p, { sheet: 'rocket' }); } }); @@ -155,8 +155,7 @@ Q.scene("level1",function(stage) { stage.insert(new Q.Starbug({ x: 600, y: 0 })); stage.insert(new Q.Neingeist({ x: 650, y: 0 })); - // Finally add the cake - stage.insert(new Q.Cake({ x: 146, y: 36 })); + stage.insert(new Q.Rocket({ x: 146, y: 32 })); }); // To display a game over / game won popup box,