diff options
| author | iamcheeseman <[email protected]> | 2026-03-12 18:10:06 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-03-12 18:10:06 -0400 |
| commit | 2b3245f44fecbf2e426bb28f522a24e00662c610 (patch) | |
| tree | 20740cedc0c063ec76ecd42794b60b414775dbd5 /src/objs/player.lua | |
| parent | 97d2fc1f3cef3c02fee36e416a8f2b5205940be2 (diff) | |
Make the room editor un-hacked in
Diffstat (limited to 'src/objs/player.lua')
| -rw-r--r-- | src/objs/player.lua | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/objs/player.lua b/src/objs/player.lua index 4b75cb3..1e41523 100644 --- a/src/objs/player.lua +++ b/src/objs/player.lua @@ -14,49 +14,11 @@ function body_sys(ent, dt) ent.y = ent.box.y end -local tile = 1 - function player_movement_sys(player, dt) local inpx, inpy = input_direction("Left", "Right", "Up", "Down") inpx, inpy = normalize(inpx, inpy) player.vx = dlerp(player.vx, inpx * PLAYER_SPEED, 25 * dt) player.vy = dlerp(player.vy, inpy * PLAYER_SPEED, 25 * dt) - - -- Testicle stuff, remove when testising is no longer needed - if not im.has_focus() then - if is_input_pressed("Right_Click") then - local scn = get_current_scene() - assert(scn, "no scene set.") - - local mx, my = get_mouse_pos() - local tx, ty = to_tile_coords(mx, my) - set_tile(scn.tilemap, tx, ty, tile) - end - if is_input_pressed("Left_Click") then - local scn = get_current_scene() - assert(scn, "no scene set.") - - local mx, my = get_mouse_pos() - local tx, ty = to_tile_coords(mx, my) - remove_tile(scn.tilemap, tx, ty) - end - end -end - -function player_ui_sys(_) - im.begin_window("Room Editor", 120, 5, 180, 320, {}) - im.layout({0.5, 0.75, 1}) - im.text("Tile: " .. tostring(tile)) - if im.button(" - ") then - tile = math.max(tile - 1, 0) - end - if im.button("+ ") then - tile = tile + 1 - end - im.layout() - - im.image(TILE_TEX, get_tileset_quad(tile)) - im.end_window() end function new_player(x, y) |
