/
main.js
56 lines (48 loc) · 1.15 KB
/
main.js
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
baa.load = function () {
game = Game.new();
creditsFont = baa.graphics.setNewFont("credits",4);
// baa.debug.set(game);
print("If you want to screw with the game settings, let me help. \nType: \nBall.reset = function () { \nthis.x = 200; \nthis.y = 72; \nthis.velocity.x = [NUMBER HERE]; \nthis.velocity.y = [NUMBER HERE]; \n}");
}
baa.update = function () {
dt = Math.min(dt,0.0166666667)
game.update();
}
baa.draw = function () {
game.draw();
}
baa.config = function (t) {
t.height = 288;
t.release = true;
}
baa.graphics.preload(
"images/smallpiece_0.png",
"images/smallpiece_1.png",
"images/smallpiece_2.png",
"images/smallpiece_3.png",
"images/smallpiece_4.png",
"images/smallpiece_5.png",
"images/smallpiece_6.png",
"images/ball.png",
"images/background.png",
"images/numbers.png",
"images/gameoverbar.png",
"images/logo.png",
"images/players.png",
"images/cursor.png",
"images/gameover.png",
"images/gamewin.png",
"images/types.png"
);
baa.audio.preload(
"audio/theme.ogg",
"audio/pong_beep.ogg",
"audio/pong_peep.ogg",
"audio/pong_plop.ogg",
"audio/line4.ogg",
"audio/line.mp3",
"audio/intro.mp3",
"audio/gate.mp3",
"audio/gameover.mp3"
)
baa.run();