Game Jam 2 - Code

 

This code is about the spikes within the 2nd Game Jam. Each spike has a different property and when you die the door unlocks and that will then let you move onto the next level. Furthermore different spikes opened different doors around the map and  when you die you respawn back at spawn just like a loop. I also added a light that follows the player so they cannot see far.
The only problem I had with this code is that the doors wouldn't open when they die. But I fixed this issue when I set a key value for each door and spike to open certain doors.
This code is the movement code where you can use a arrows keys or WASD for movement to make their be variation and for the player to use there preference. We also have added the collision code so the player cannot go through the walls and not break the games. I had no issues with part of the code.
This defines all the variables needed and makes the character a solid. The values for speed and to make the light in a different instance follow the player.
Finally this lets the door open when the makes index of the spike different.

Comments