mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 11:03:23 +00:00
57 lines
1.7 KiB
HTML
57 lines
1.7 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>phaser.js - a(nother) new beginning</title>
|
||
|
<script src="../src/Phaser.js"></script>
|
||
|
<script src="../src/system/Device.js"></script>
|
||
|
<script src="../src/core/SignalBinding.js"></script>
|
||
|
<script src="../src/core/Signal.js"></script>
|
||
|
<script src="../src/math/RandomDataGenerator.js"></script>
|
||
|
<script src="../src/animation/Animation.js"></script>
|
||
|
<script src="../src/animation/Frame.js"></script>
|
||
|
<script src="../src/animation/FrameData.js"></script>
|
||
|
<script src="../src/animation/Parser.js"></script>
|
||
|
<script src="../src/loader/Cache.js"></script>
|
||
|
<script src="../src/loader/Loader.js"></script>
|
||
|
<script src="../src/Game.js"></script>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
|
||
|
function loadStarted(size) {
|
||
|
console.log('Loader started, queue size:', size);
|
||
|
}
|
||
|
|
||
|
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
|
||
|
function fileLoaded(progress, key, success, remaining, total) {
|
||
|
console.log('File Loaded:', key);
|
||
|
console.log('Progress: ' + progress + '%');
|
||
|
console.log('File: ' + remaining + ' out of ' + total);
|
||
|
}
|
||
|
|
||
|
function loadCompleted() {
|
||
|
|
||
|
console.log('Loader finished');
|
||
|
|
||
|
// Let's try adding an image to the DOM
|
||
|
//document.body.appendChild(game.cache.getImage('mummy'));
|
||
|
|
||
|
// Dump the animation data out
|
||
|
//console.log(game.cache.getFrameData('mummy'));
|
||
|
}
|
||
|
|
||
|
var game = new Phaser.Game(this, '', 800, 600);
|
||
|
|
||
|
game.load.audio('music', [ 'assets/audio/oedipus_wizball_highscore.mp3', 'assets/audio/oedipus_wizball_highscore.ogg' ], true);
|
||
|
|
||
|
game.load.onLoadStart.add(loadStarted, this);
|
||
|
game.load.onFileComplete.add(fileLoaded, this);
|
||
|
game.load.onLoadComplete.add(loadCompleted, this);
|
||
|
|
||
|
game.load.start();
|
||
|
|
||
|
</script>
|
||
|
|
||
|
</body>
|
||
|
</html>
|