Gamejam Devlog - Timedust v0.0.41 - Suspended Trap


Ok today, a word about the suspended trap and how I did it.
With the experience I gained from the gameje, I discovered a better and more practical way to do this. But at the time, I was in the rush of the game jam, so I had to move in order to not get stuck too long on an issue.

So, for those traps, I used a combination of the the animation nodes: an AnimatedSprite2D for changing the sprite, and an AnimationPlayer for changing the collision mask.
I used one CollisionShape 2D and I changed its shape on each frame to match the animation.

Timedust devlog suspended trap

Two animation nodes for the same object
The main issue I encountered is that I use the AnimatedSrpite2D speed property to set my default animation speed. (Then the Timedust effect slows that speed). However, I couldn't do the same with the AnimationPlayer node: the collision mask animation wouldn't follow the sprites.
So I had to do some research in order to have control on the speed of the AnimationPlayer, so I could synchronize it with the sprites animation speed.
I had to go through trial and error to eventually find the maths that match perfectly the sprite animation.
So it worked in the end, but later in the jam, when I worked on the animated spikes, I found another way that I think is maybe more adapted:
using different CollisionMasks, hiding and unhiding them depending which animation frame is currently playing.

Timedust devlog animated collision mask

Trial and error eventually led me to find the maths

Get Timedust - Jam Edition

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.