summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-24 21:10:41 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-24 21:10:41 -0700
commit9cb48c504ddb3882f39e2b17048f0593316a95ce (patch)
tree9852098ec856bd1e8860186d80c458811541452d /src/content
parente1724b9af036c70fcce8fa249f62bf9807d29b6b (diff)
bullet tweaks
Diffstat (limited to 'src/content')
-rw-r--r--src/content/entities/entity_bullet_emitter.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/content/entities/entity_bullet_emitter.rs b/src/content/entities/entity_bullet_emitter.rs
index cddb4b3..c014e8c 100644
--- a/src/content/entities/entity_bullet_emitter.rs
+++ b/src/content/entities/entity_bullet_emitter.rs
@@ -25,16 +25,13 @@ impl EntityBehaviour for BulletEmitterEntityBehaviour {
}
if let Some(target) = self.target {
+ let pos = update_ctx.entity_data.transform(ctx).unwrap().0;
+ let dir = (target - pos).normalize();
+
self.shot_timer -= delta_time;
if self.shot_timer <= 0.0 {
- apply_bullet(
- ctx,
- update_ctx.entity_data.transform(ctx).unwrap().0,
- target,
- 1000,
- );
- // self.shot_timer = 0.1;
- update_ctx.deferred_destroy(update_ctx.entity_data.id);
+ apply_bullet(ctx, pos + (dir * 4.0), target, 70);
+ self.shot_timer = 0.1;
}
self.life -= delta_time;