Skip to content

Commit 0839b02

Browse files
authored
Merge branch 'main' into bugfix/improve-collisions
2 parents 8361da7 + 6723533 commit 0839b02

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Main.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ function initialize_scripts_and_components()
275275
end
276276
build_sprite_layers()
277277
end
278-
279-
MAIN.scene.rigidbodies = []
280-
MAIN.scene.colliders = []
278+
279+
MAIN.scene.rigidbodies = []
280+
MAIN.scene.colliders = []
281281
for entity in MAIN.scene.entities
282282
@debug "adding rigidbodies to global list"
283283
if entity.rigidbody != C_NULL

src/engine/Component/Rigidbody.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
parent::Any
2222
useGravity::Bool
2323
velocity::Math.Vector2f
24-
elapsedTime
2524

2625
function InternalRigidbody(parent::Any; mass::Float64 = 1.0, useGravity::Bool = true)
2726
this = new()
@@ -34,15 +33,13 @@
3433
this.parent = parent
3534
this.useGravity = useGravity
3635
this.velocity = Math.Vector2f(0.0, 0.0)
37-
this.elapsedTime = 0.0
36+
3837
return this
3938
end
4039
end
4140

4241
function Component.update(this::InternalRigidbody, dt)
4342
dt = clamp(dt, 0, .5)
44-
this.elapsedTime += dt
45-
4643
velocityMultiplier = Math.Vector2f(1.0, 1.0)
4744
transform = this.parent.transform
4845
currentPosition = transform.position

0 commit comments

Comments
 (0)