” Attack the fruit before it attacks you!”

Quick Facts
| Type of project: |
| Coursework, Group |
| Date Produced: |
| Winter 2018 |
| programs used: |
| Unity Adobe PhotoShop GitHub |
Key points
- My primary role in the group was programming gameplay and input of tilting a device.
- Tasks include implementing movement of the player and enemy, constructing builds of the game and task management.
- The main goal is to attack mutant fruit with punches before they attack you.
the full story
The objective of this project was to produce a 2D game, playable on a device with a touch screen. The game must be reactive to the player tilting the device. My primary role was gameplay programming. My other tasks were The implementation of the tilt function and building the game to a tablet.
The first phase of the project was designing and creating basic 2D models for the game. I contributed by creating a mutant creature in the shape of a strawberry. To help with the environment, I drew multiple sprites that belong in a “lab” setting. The game takes place on a slanted camera angle which is similar to the isometric view; however, this produced a problem.
In video games, there is a concept called a hitbox. This box would determine what is inside of it and what is not throughout the game. When the character’s hitbox collides with the wall, it stops the character from moving any further. The problem is that the hitbox had to be small to achieve this, which means projectiles like seeds would hit the character model but not the hitbox itself. A solution to this is to create another hitbox and adapt it to collide differently. This resolution meant that the hitbox would not clash with the walls but will detect projectiles.
Most 2D games (super Mario bros, Terraria, etc.) allows the player to move left and right. Jumping in a game brings the character up and down gradually so the player cannot control how high or low they are if they are not on a platform. However, with our Game, the player and enemies can go in all four directions. The enemies would have to go around obstacles to reach the player. This task proved difficult as they did not have a route to follow.
For this particular problem, my solution was to create a basic pathfinding algorithm which directs the enemies to the player. Enemies move a direction, getting closer to the player. This solution required a graph and Adjeancy matrix: a map of points that the enemies can follow if they cannot see the player. They follow these points until they can see the player, which makes the enemies move freely.