Added a feature in the game which is the Skibidi Titan which follows the player around. It stops every 4 seconds to shoot a beam down at the user which if the user touches, they will die. This feature was complicated to add due to it's complex features and using several files.
The skibidi titan file is SkibidiTitan.js
In this file, there is a variable which is called debounce which is used to power the titan. I do not think this is the most efficient way to do this however but I am unfamiliar with dealing with things like this in js.
The main code which powers the Titan is the following which is in the update() loop:
Added a feature in the game which is the Skibidi Titan which follows the player around. It stops every 4 seconds to shoot a beam down at the user which if the user touches, they will die. This feature was complicated to add due to it's complex features and using several files.
The skibidi titan file is
SkibidiTitan.js
In this file, there is a variable which is calleddebounce
which is used to power the titan. I do not think this is the most efficient way to do this however but I am unfamiliar with dealing with things like this in js. The main code which powers the Titan is the following which is in the update() loop:Here is the sprite image file location:
/images/platformer/sprites/skibidiTItan.png
This is the code to spawn in your own skibidi titan in gameSetup.js:
The collision for the laser is in:
PlayerSkibidi.js
Here is the code:
Here is the finished Skibidi Titan:
https://github.com/Tvick22/platformer3x/assets/114638384/f2cf2117-9c91-443d-9b3a-f02ff5ac9507