Skip to content

Commit

Permalink
prevent saws from going off-track and make them sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
Quillraven committed Mar 26, 2024
1 parent b8c152b commit 36d9bf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions assets/maps/objects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<properties>
<property name="density" type="float" value="100"/>
<property name="isChain" type="bool" value="true"/>
<property name="isSensor" type="bool" value="true"/>
<property name="userData" value="hitbox"/>
</properties>
<ellipse/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TrackSystem : IteratingSystem(World.family { all(Move, Track, Graphic) })
// move towards current track point
val currentX = sprite.x + sprite.width * 0.5f
val currentY = sprite.y + sprite.height * 0.5f
if (currentIdx == -1 || trackVertices[currentIdx].inRange(currentX, currentY, 0.1f)) {
if (currentIdx == -1 || trackVertices[currentIdx].inRange(currentX, currentY, 0.2f)) {
// entity reached current track point -> go to next track point
trackCmp.currentIdx = currentIdx + direction
if (trackCmp.currentIdx >= trackVertices.size) {
Expand Down

0 comments on commit 36d9bf2

Please sign in to comment.