breakout/config.js
2023-04-30 03:11:17 +00:00

58 lines
919 B
JavaScript

gameobject.clone("ball", {
collider: circle2d.clone(),
img: sprite.clone(),
});
var Gameboy = {
darkest: [15,56,15],
dark: [48,98,48],
light: [139,172,15],
lightest: [155,188,15]
};
var Rainbow = {
red: [204,0,1],
orange: [255,102,0],
darkorange: [205,102,1],
yellow: [205,204,0],
green: [0,153,1],
blue: [53,51,255]
};
var Resources = [];
Resources["brick.png"] = {
frames:6,
fps:24,
loop:false
};
gameobject.clone("brick", {
collider: polygon2d.clone(),
char: char2d.clone({
flash:"brick.png"
}),
start() {
this.char.stop();
this.flash();
this.timer = timer.make(() => {
this.flash();
this.timer.time = Math.random_range(2,10);
}, Math.random_range(2,10));
},
flash() {
this.char.play("flash");
},
stop() {
this.timer.kill();
},
});
gameobject.clone("paddle", {
collider: polygon2d.clone(),
img: sprite.clone(),
});