allow for levels to change player & goal sizes.

This commit is contained in:
trans_soup 2023-10-27 15:40:23 +02:00
parent d85bd962a0
commit c437b07b03
2 changed files with 11 additions and 3 deletions

View file

@ -32,9 +32,14 @@ Event.listen("level/load/goal", (data = {}) => {
x: 0,
y: 0,
},
size: {
x: 40,
y: 40,
},
});
Entity.set_pos(goal, data.pos.x, data.pos.y);
Entity.set_size(goal, data.size.x, data.size.y);
Entity.set_visible(goal, true);
Entity.set_physical(goal, true);

View file

@ -11,9 +11,7 @@ import { underride } from "./underride.mjs";
const player = Entity.create(0, 0, 20, 20);
export function get_player () {
return player;
}
export function get_player () { return player; }
function tick_player (deltatime) {
const meta = Entity.get_meta(player);
@ -43,10 +41,15 @@ Event.listen("level/load/player", (data = {}) => {
x: 0,
y: 0,
},
size: {
x: 20,
y: 20,
},
speed: 100,
});
Entity.set_pos(player, data.pos.x, data.pos.y);
Entity.set_size(player, data.size.x, data.size.y);
const meta = Entity.get_meta(player);