This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //From http://www.gamedevacademy.org/html5-phaser-tutorial-top-down-games-with-tiled/ | |
| //find objects in a Tiled layer that containt a property called "type" equal to a certain value | |
| findObjectsByType: function(type, map, layer) { | |
| var result = new Array(); | |
| map.objects[layer].forEach(function(element) { | |
| console.log(element); | |
| if (element.properties.type === type) { | |
| //Phaser uses top left, Tiled bottom left so we have to adjust the y position | |
| //also keep in mind that the cup images are a bit smaller than the tile which is 16x16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ig.module( | |
| 'game.plugins.gamepad' | |
| ) | |
| .requires( | |
| 'impact.input', | |
| 'impact.game' | |
| ) | |
| .defines(function(){ | |
| // Assign some values to the Gamepad buttons. We use an offset of 256 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/htdocs/lib/weltmeister/edit-entities.js b/htdocs/lib/weltmeister/edit-entities.js | |
| index f9d9250..6272f3e 100644 | |
| --- a/htdocs/lib/weltmeister/edit-entities.js | |
| +++ b/htdocs/lib/weltmeister/edit-entities.js | |
| @@ -141,7 +141,7 @@ wm.EditEntities = ig.Class.extend({ | |
| for( var i = 0; i < this.entities.length; i++ ) { | |
| var ent = this.entities[i]; | |
| if( ent.touches(this.selector) ) { | |
| - this.selector.offset = {x: (x - ent.pos.x + ent.offset.x), y: (y - ent.pos.y + ent.offset.y)}; | |
| + this.selector.offset = {x: (x - ent.pos.x), y: (y - ent.pos.y)}; |