summaryrefslogtreecommitdiff
path: root/dyl.lua
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-05-28 21:01:02 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-05-28 21:01:02 -0700
commit16c1140ead99064799113eb3d8ddcf47929bba70 (patch)
tree39222a2af7491afaf0efd7fa9b5771d0283c78cc /dyl.lua
parent661156ce988131eb4896a7af4d00a42b520305e7 (diff)
downloaddyl8-main.tar.gz
dyl8-main.zip
Adding debug collision boxes, making bullets hurt you, and be able to kill bullets upon consumptionHEADmain
Diffstat (limited to 'dyl.lua')
-rw-r--r--dyl.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/dyl.lua b/dyl.lua
index 116315b..9e60dd3 100644
--- a/dyl.lua
+++ b/dyl.lua
@@ -1,3 +1,5 @@
+DEBUG = true
+
_slashing_timer_sec = .12
_slash_animation_distance = 3
function slashing_particle(following)
@@ -53,6 +55,7 @@ function fire()
end
function enemy()
+ _enemy_damage_spec = { amount = 2, knockback = { magnitude = 200, time = 0.120 } }
EnemyBuilder = EntityBuilder:new(World)
function EnemyBuilder:transition_state()
end
@@ -61,6 +64,7 @@ function enemy()
:b_position(vec2(30, -40))
:b_sprite_position(vec2(30, 40))
:b_line_of_sight(vec2(1, 0))
+ :b_damage(_enemy_damage_spec)
:b_render_order(1)
:b_collidable()
:b_add_state(
@@ -263,7 +267,9 @@ function player()
:b_render_order(2)
:b_collidable()
:b_position(vec2(30, 30))
+ :b_health(10)
:b_sprite_position(vec2(30, 30))
+ :b_collision_bounds(vec2(2, 2), vec2(5, 6))
:b_add_state(
States.Idle, {
animation = {