This file contains 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 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 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 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 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 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
function foo() { | |
return <div>{'{ss'}</div>; | |
} | |
console.log(1); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>space shooter - tutorial - 13zmiennych.blogspot.com </title> | |
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script src="index.js"></script> | |
</head> | |
<body> |
This file contains 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
function loadImages(directory, fileNames, onComplete) { | |
}; | |
function initialize() { | |
// tu bedzie kod inicjalizujacy gre... | |
}; | |
$(document).ready(function() { |
This file contains 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
function loadImages(directory, fileNames, onComplete) { | |
var imagesLeft = fileNames.length; | |
fileNames.forEach(function(fileName) { | |
var img = new Image(); | |
img.onload = function() { | |
imagesLeft--; // tu zliczamy ile obrazkow się zaladowalo | |
if (imagesLeft <= 0) // jesli wszystkie obrazki sie zaladowaly... | |
onComplete(); // uruchamiamy funkcje onComplete (podana jako argument funkcji) | |
}; |
This file contains 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
function loadImages(directory, fileNames, onComplete) { | |
fileNames.forEach(function(fileName) { | |
var img = new Image(); | |
img.src = directory + '/' + fileName; // here!!! magic happens | |
}); | |
}; |
OlderNewer