This commit is contained in:
John Alanbrook 2023-05-12 18:22:56 +00:00
parent 9d7a5f0163
commit 6f09bc72fb
5 changed files with 60 additions and 17 deletions

View file

@ -1,6 +1,10 @@
gameobject.clone("ball", { gameobject.clone("ball", {
collider: circle2d.clone(), collider: circle2d.clone(),
img: sprite.clone(), img: sprite.clone(),
collide(hit) {
Sound.play("bump.wav");
},
}); });
var Gameboy = { var Gameboy = {
@ -68,7 +72,12 @@ var paddle = gameobject.clone("paddle", {
v[1] = 0; v[1] = 0;
this.pos = this.pos.add(v.scale(this.speed*Yugine.dt)); this.pos = this.pos.add(v.scale(this.speed*Yugine.dt));
}, },
setup() { setup() {
Player.players[0].control(this); Player.players[0].control(this);
}, },
collide(hit) {
Log.warn("hit");
},
}); });

View file

@ -9,10 +9,10 @@
"Collision": { "Collision": {
"types": { "types": {
"0": [ "0": [
false, true,
false, true,
false, true,
false, true,
false, false,
false, false,
false, false,
@ -21,10 +21,10 @@
false false
], ],
"1": [ "1": [
false, true,
false, true,
false, true,
false, true,
false, false,
false, false,
false, false,
@ -33,10 +33,10 @@
false false
], ],
"2": [ "2": [
false, true,
false, true,
false, true,
false, true,
false, false,
false, false,
false, false,
@ -45,10 +45,10 @@
false false
], ],
"3": [ "3": [
false, true,
false, true,
false, true,
false, true,
false, false,
false, false,
false, false,

View file

@ -1 +0,0 @@
Yugine v. 0.0.1-43a543e, sys dbg.

35
game.js
View file

@ -3,3 +3,38 @@ sim_start();
World.loadfile("lvl1.lvl"); World.loadfile("lvl1.lvl");
World.spawn(gameobjects['ball']); World.spawn(gameobjects['ball']);
//Sound.play("start.wav");
var camcontroller = {
input_a_down() {
cmd(99);
},
input_d_down() {
cmd(100);
},
input_q_down() {
cmd(98);
},
input_e_down() {
cmd(97);
},
input_w_down() { cmd(101); },
input_s_down() { cmd(102); },
};
function texttest()
{
GUI.text("test 1", [0,0], 1,[5,120,240]);
GUI.text("test 2", [100,100],1,[100,2,250]);
}
register_gui(texttest);
Log.warn("set controller");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB