aboutsummaryrefslogtreecommitdiff
path: root/src/room_editor.lua
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-13 15:36:41 -0400
committeriamcheeseman <[email protected]>2026-03-13 15:36:41 -0400
commitfca851822e2f3138d0e15c93768ebc4937a0b23a (patch)
treef2899c61ceb3d07c369c221c307d9ca3afce12e7 /src/room_editor.lua
parent2b8a3df8749bb73f1d070d76aa304e5b85a1f3fc (diff)
Moving entities; deleting entities
Diffstat (limited to 'src/room_editor.lua')
-rw-r--r--src/room_editor.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/room_editor.lua b/src/room_editor.lua
index 01d5c90..1aee150 100644
--- a/src/room_editor.lua
+++ b/src/room_editor.lua
@@ -185,6 +185,23 @@ local brushes = {
table.insert(room_editor.placed_entities, ent)
room_editor.selected_ent = #room_editor.placed_entities
end
+ elseif is_input_pressed("Left_Click") then
+ local selected_ent = get_selected_entity(room_editor)
+ if selected_ent then
+ mx, my = get_snapped_to_grid(room_editor, mx, my)
+ selected_ent.x = mx
+ selected_ent.y = my
+ end
+ end
+
+ if is_input_just_pressed("Delete") then
+ local selected_ent = get_selected_entity(room_editor)
+ if selected_ent then
+ queue_entity_kill(selected_ent)
+ room_editor.placed_entities[room_editor.selected_ent] =
+ table.remove(room_editor.placed_entities)
+ room_editor.selected_ent = -1
+ end
end
end
}