Game Jam 1 - Code

When I was creating the collision code the easiest part was finding the place meeting when it touches the walls. Additionally, GameMaker also provides the option to create collision masks that can be used to define the precise shape of an object's collision boundary, I used this to my advantage and gave all the sprites the same collision

However, problems happened within the code as one of the common issues is that the collision detection sometimes didn't work and got stuck in the wall. This lead to the game crashing and lagging out. However I fixed this issue by changing the collision mask for each animation.

These are the variables that were used within all the games. The gravity I kept adjusting to make sure the player could reach certain points within the game adjusting the difficulty.
The movement speed had to be changed to fix with the potion 2 within the game as sometimes it would make the game unplayable. The potions had custom variables to make them all work better as well.
This is the code for the character to fall of the screen and not die and for the character to look the way it is moving which can only face left or right as we had a separate with jumping and falling animations.
Next, this helps to use the variables that we pre defined the variables which then give them a value for movement and to see if you can jump. Furthermore I had to keep changing the values for the max fall speed as it would keep getting the player stuck in the floor and make it unplayable so I kept lowering the values.
These are the key binds for the movement of potion 1. The side effects of it is when you touch the potion it inverts your keys. I didn't have any issues with this part of the code as I used an if and else statement to determine what controls they will have.
This is Potion 3, This potion rotates your screen by 1.51 and completely flips it. Furthermore, I had problems with the flipping as I didn't have an exact value that to flip it accurately. When you take 2 of the potions it will fully 360 your screen but the angle will not be accurate and will become lopsided which is the only issue I have this part of the code.
This is the code for potion 2. This potion changes your full sprite into a random colour in rgb. Furthermore it increases your speed and constantly multiplies your speed every time you touch the same potion. The only issue I had with this code was that I didn't know the right value for the running and it was either too low or too high but then I stuck to the value of 1.005.

 Finally, this is the code that makes the potions gain values and then make the potion that you touch disappear from the game and make their unique power work. Sadly, I didn't have enough time to add more potions but I can finish it at a later date.

Comments

Popular Posts