Skip to content

Commit

Permalink
Collider clean up (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor authored Dec 16, 2023
1 parent a666835 commit d48c066
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
15 changes: 0 additions & 15 deletions src/Component/Collider.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module ColliderModule
include("../Enums.jl")
using ..Component.JulGame
global const GRAVITY = Ref{Float64}(9.81)[]

export Collider
mutable struct Collider
Expand All @@ -27,20 +26,6 @@ module ColliderModule

return this
end

function Collider(size::Math.Vector2f, tag::String)
this = new()

this.collisionEvents = []
this.currentCollisions = []
this.enabled = true
this.isTrigger = false
this.offset = Math.Vector2f()
this.size = size
this.tag = tag

return this
end
end

function Base.getproperty(this::Collider, s::Symbol)
Expand Down
1 change: 0 additions & 1 deletion src/Component/Rigidbody.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module RigidbodyModule
using ..Component.JulGame
const GRAVITY = Ref{Float64}(9.81)[]

export Rigidbody
mutable struct Rigidbody
Expand Down
2 changes: 1 addition & 1 deletion src/SceneManagement/SceneReader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module SceneReaderModule
end
newComponent = Animator(newAnimations)
elseif component.type == "Collider"
newComponent = Collider(Vector2f(component.size.x, component.size.y), component.tag)
newComponent = Collider(Vector2f(component.size.x, component.size.y), Vector2f(), component.tag)
newComponent.isTrigger = !haskey(component, "isTrigger") ? false : component.isTrigger
newComponent.offset = !haskey(component, "offset") ? Vector2f() : Vector2f(component.offset.x, component.offset.y)
elseif component.type == "Rigidbody"
Expand Down

0 comments on commit d48c066

Please sign in to comment.