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
| const speck = require('speckjs'); | |
| const fs = require('fs'); | |
| const name = './src/index.js'; | |
| speck.build({name: name, content: fs.readFileSync(name, 'utf8')}, {ecmaVersion: 6, sourceType: 'module'}); |
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
| Object.defineProperty(window, 'debug', { | |
| set: console.log.bind(console) | |
| }); | |
| debug = 'HelloWorld'; | |
| debug = 'twelve: ' + (2+10); |
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
| game.add.sprite(10, 100, 'jednostka_1'); | |
| // kod inicjalizujacy jednostke 1... | |
| game.add.sprite(10, 100, 'jednostka_2'); | |
| // kod inicjalizujacy jednostke 2... | |
| game.add.sprite(10, 100, 'jednostka_3'); | |
| // kod inicjalizujacy jednostke 3... | |
| ... | |
| game.add.sprite(10, 100, 'jednostka_n'); | |
| // kod inicjalizujacy jednostke n... |
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
| game.load.image('zolnierz', 'img/zolnierz.png'); | |
| game.load.image('bandzior', 'img/bandzior.png'); | |
| game.load.image('czolg', 'img/czolg.png'); | |
| game.load.image('ulica', 'img/ulica.png'); | |
| ... | |
| game.add.sprite(10, 100, 'zolnierz'); | |
| game.add.sprite(10, 150, 'zolnierz'); | |
| game.add.sprite(10, 200, 'zolnierz'); | |
| game.add.sprite(0, 0, 'ulica'); |
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
| { | |
| "images": [ | |
| ["zolnierz", "/img/bandzior.png"], | |
| ["bandzior", "/img/bandzior.png"], | |
| ["czolg", "/img/czolg.png"], | |
| ["ulica", "/img/ulica.png"] | |
| ], | |
| "levels": [ | |
| { | |
| "objects": [ |
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
| var MISSILE_SPEED = 3; |
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
| missile.x = this.x + this.img.width / 2 - missile.img.width / 2; | |
| missile.y = this.y - missile.img.height; |
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
| case 'fire': | |
| var missile = createEntity('missile', {}); | |
| missile.x = this.x | |
| missile.y = this.y; | |
| missile.vy = -MISSILE_SPEED; | |
| break; |
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
| var key = {37: 'left', 38: 'up', 39:'right', 40:'down', 32:'fire'}[e.keyCode]; |
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
| key = {37: 'left', 38: 'up', 39:'right', 40:'down'}[e.keyCode]; |