aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-19 19:55:33 -0400
committeriamcheeseman <[email protected]>2026-03-19 19:55:33 -0400
commita1528b5860074e29dfb6814193ff7c618caa7339 (patch)
treecdf2a2390557837add5d14f1e775663bcb2ded1b
parent49e527a25c658dedaac0c00dfaa0938d4ba4d4e3 (diff)
add initial velocity to specks
-rw-r--r--src/objs/player.lua3
-rw-r--r--src/objs/specks.lua5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/objs/player.lua b/src/objs/player.lua
index 3f1e2aa..4a12334 100644
--- a/src/objs/player.lua
+++ b/src/objs/player.lua
@@ -101,6 +101,9 @@ function new_player(x, y)
ent.speck_sys.lifetime_max = 0.6
ent.speck_sys.lifetime_min = 0.3
+ ent.speck_sys.initial_velx = 100
+ ent.speck_sys.initial_vely = -75
+
ent.speck_sys.forcey = 1000
ent.speck_sys.bounce = true
diff --git a/src/objs/specks.lua b/src/objs/specks.lua
index 736b9aa..229eb23 100644
--- a/src/objs/specks.lua
+++ b/src/objs/specks.lua
@@ -30,6 +30,9 @@ function Speck_Sys.new()
self.forcex = 0
self.forcey = 0
+ self.initial_velx = 0
+ self.initial_vely = 0
+
self.lifetime_min = 1
self.lifetime_max = 5
@@ -76,7 +79,7 @@ function Speck_Sys:update(dt)
data.alive[id] = true
data.pos[id] = { x = self.x, y = self.y }
- data.vel[id] = { x = 0, y = 0 }
+ data.vel[id] = { x = self.initial_velx, y = self.initial_vely }
data.lifetime[id] = randf_range(
self.lifetime_min, self.lifetime_max)