Skip to content

Commit 3bfea21

Browse files
committed
Start of the Dragonfire game sample
1 parent f9ee9bf commit 3bfea21

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

9.72 KB
Loading

examples/assets/wip/karamoon.png

6.75 KB
Loading

examples/wip/dragonfire.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render });
3+
4+
var background;
5+
var filter;
6+
7+
function preload() {
8+
9+
game.load.spritesheet('dragon', 'assets/sprites/stormlord-dragon96x64.png', 96, 64);
10+
game.load.image('sky', 'assets/skies/sky2.png');
11+
game.load.image('land', 'assets/wip/karamoon.png');
12+
game.load.script('fire', '../filters/Fire.js');
13+
14+
}
15+
16+
var sky;
17+
var background;
18+
var fire;
19+
var dragon;
20+
21+
function create() {
22+
23+
sky = game.add.sprite(0, 600, 'sky');
24+
sky.scale.y = -1;
25+
sky.alpha = 0.5;
26+
27+
fire = game.add.sprite(0, 200);
28+
fire.width = 800;
29+
fire.height = 400;
30+
31+
background = game.add.sprite(0, 0, 'land');
32+
33+
dragon = game.add.sprite(100, 300, 'dragon');
34+
dragon.animations.add('flyright', [0,1,2,3,4,5], 10, true);
35+
dragon.play('flyright');
36+
37+
filter = game.add.filter('Fire', 800, 400);
38+
filter.alpha = 0.0;
39+
fire.filters = [filter];
40+
41+
}
42+
43+
function update() {
44+
45+
filter.update();
46+
47+
}
48+
49+
function render() {
50+
51+
// filter.update();
52+
53+
}

0 commit comments

Comments
 (0)