Day 5
I spent the night working on creating the freeze tower that temporarily stops enemies along the path when the tower "shoots". I initially made a new object with no sprite. In the draw step, I drew a circle with a progressively larger radius. When the radius maximum was met, I progressively reduced the alpha of the circle. Once the alpha was 0, the object is destroyed. Code was then added to see which enemies were within the radius of the blast and set their path speed to 0 as well as set new variable on the enemy object, freezetimer, to 60. This timer value is decremented in an alarm. Once it's 0, the enemy's speed is reset to it's default speed, until it get's frozen again. Multiple freeze towers would not set the freezetimer past 60, instead it is always reset to 60. They could potentially add more time to the freezetimer, but then the user could keep everything frozen on screen, thus making the game too easy. Once the freeze effect was working, I added the freeze aoe object as the bullet of the freeze tower. The issue I had here, the aoe was always being drawn over everything else and I didn't like how it looked. I ended up drawing a 200x200 sprite for the aoe and assigning it to the aoe object. I changed my code to increment the scale of the circle each frame and then also the alpha after. I thought having the sprite would solve the issue of drawing over everything but it did not. After quite a while, I learned I could add more instance layers to a room and draw objects to those specific layers. Towers, enemies and bullets all got their own layers and the aoe was now drawing under the tower and enemies as intended. Success!
Next I will be coding the cannon tower that shoots cannonballs and damages enemies in an area.
Files
Bloons TD Jam
Status | In development |
Author | murvkins |
More posts
- Day 41 day ago
- Day 1 Progress2 days ago
- Day 32 days ago
Leave a comment
Log in with itch.io to leave a comment.