Enemies and Interactions
This devlog is about enemies and interactions for the player, lava and fireball game objects.
The enemies that I have created for this game is the lava, which sits at the bottom of the game. There are additional enemies in the fireballs that shoot up from the lava.
The lava contains a Box Collider that acts as a trigger and a 2D Rigidbody. The lava has been set up as a trigger when the player touches it. The player’s death animation is triggered which then also resets the game.
I’ve created a Prefab of the Fireball and the code allows the speed and the maximum height it can be reached. This prefab also contains its own movement script. This script controls the upwards movement of the fireballs and the collision detector to destroy the fireball. The script also controls the speed and the max height it can shoot up to.
The fireball is called from a spawning point under the gameplay screen, The spawning point has code that will shoot up three fireballs and won’t respawn until all three have been destroyed. This is a public field so it can be updated. The Fireball spawn also has a control for the time between respawns. This is currently set to one second. Under the fireball spawn area is an empty game object with a collider. When the fireballs come back down, assuming they don’t hit the player, the game objects will destroy once they hit the collider (below).
When the player interacts with the fireball or the lava this kills the player, initiating the death animation, both below. The script that controls the player movement contains code that will reset that game. I have also added an Event in the Death Animation that is called upon to reset the game.
Files
Don't Touch The Lava
More posts
- User GuideMay 31, 2024
- Game UpdatesMay 30, 2024
- Game TestingMay 29, 2024
- User InterfaceMay 25, 2024
- Graphics and AnimationsMay 18, 2024
- Basic BlockingMay 04, 2024
- Player MovementApr 27, 2024
- Game Concept - Don't Touch The LavaApr 18, 2024
Leave a comment
Log in with itch.io to leave a comment.