top of page
Search

Boss Fight

  • seanmcgarry65
  • Feb 24, 2023
  • 2 min read

This week the boss fight was finished.


This code controls the introduction to the boss fight. As the player approaches, their controls are disabled preventing them from moving while the intro plays out. The boss text then fades in followed by the boss itself. After the text is finished, the boss fades out and starts the timer for its teleportation, followed by the player's controls being re-enabled.


This code allows the boss to teleport. There are six designated locations that it can teleport to. It chooses one randomly, sets it's position to that location, then fades in. It then starts a timer to teleport again.


Every time the boss teleports, it spawns a bullet which waits for 2 seconds, then launches itself at the player's current location.


This code is a placeholder to handle the player being damaged by the boss's attack since it wasn't added to the normal family for enemy projectiles.


The boss is set to be invincible during the intro so that it can't be damaged before the fight starts. Once the fight DOES start, it can now be damaged by the player. Being hit with the player's weapons subtracts health from the boss (using the sword it must be hit three times) and plays a sound. The opacity is set to 100 and it plays its 'hit' animation. The boss is then set to be invincible until the next time it teleports so that the player can only hit it once per teleport. It then starts the process of teleporting again.


When the player finally gets the boss down to zero health, the boss's teleportation is disabled and all of its current projectiles are destroyed. It sets the animation to hit and fades in one last time, while text announcing its defeat is displayed. It then waits two seconds before being destroyed. The player has won!


The game can be played by following the link below.




 
 
 

Recent Posts

See All

Comments


bottom of page