-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgame3.js
More file actions
58 lines (55 loc) · 1.38 KB
/
game3.js
File metadata and controls
58 lines (55 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Generated by CoffeeScript 1.6.3
(function() {
var RubyMonsterGame;
RubyMonsterGame = function() {
window.Q = Quintus({
development: true
}).include("Sprites, Scenes, 2D, Input, UI, Touch, Anim").setup({
maximize: true
}).controls();
Q.Sprite.extend("Player", {
init: function(p) {
this._super(p, {
sprite: "ruby_monster",
sheet: "sprite_map",
animation: "basic",
x: 105,
y: 10,
gravity: 0,
vy: -1000,
speed: 400
});
return this.add('2d, platformerControls, animation, alwaysFaceFront');
}
});
Q.scene("level1", function(stage) {
var player;
stage.insert(new Q.Repeater({
asset: "game_background.jpg",
speedX: 0.5,
speedY: 0.5,
type: 0
}));
player = new Q.Player();
stage.insert(player);
return stage.add('viewport').follow(player, {
x: true,
y: true
});
});
Q.animations("ruby_monster", {
basic: {
frames: [0, 1, 2],
rate: 1 / 2
}
});
return Q.load("game_background.jpg, sprite_map.png", function() {
Q.sheet("sprite_map", "sprite_map.png", {
tilew: 100,
tileh: 100
});
return Q.stageScene("level1");
});
};
window.addEventListener("load", RubyMonsterGame);
}).call(this);