Games Development / Task 3

20/11/2024 - 16/12/2024 / Week 9 - Week 12
Iman binti Kamarudin / 0364014
Games Development / Bachelors of Design (Hons) in Creative Media
Task 3:


LECTURE

Week 9
We learned how to import sprite sheets and slice them into individual 'frames'. 


Week 10
In week 10, we continued on from the week 7 exercise. We imported the player sprite sheet and switched between the animations depending on what the player is doing (walking, attack, jumping). We also learned how to make it so the player can attack enemies and deduct health bar points and make the enemy disappear.


Week 11
In week 11, we continued with our previous exercise. We learned how to make a healthbar for the player and have it deplete as it gets hit by the enemy. We also learned how to apply a knockback effect when the player gets hit.


Week 12
During week 12, we had a consultation session in class.



INSTRUCTIONS


TASK 3
I created some additional items that I didn't get the chance to draw for task 2 as well animations for the player and enemies.

Fig 1.1 - Empty Checkpoint Sprite

Fig 1.2 - Full Checkpoint Sprite

Fig 1.3 - Spark Replenish Item

Fig 1.4 - Player Spritesheet

Fig 1.5 - Player Attack Spritesheet

Fig 1.6 - Long-ranged Enemy Spritesheet

Fig 1.7 - Short-ranged Enemy Spritesheet


I revamped the UI elements because they looked really bland to me

Fig 1.8 - Heart Item Sprite

Fig 1.9 - Full Spark UI Sprite

Fig 1.10 - Empty Spark UI Sprite

Fig 1.11 - Health Bar Background Sprite

Fig 1.12 - Health Bar Sprite

Lastly, I drew out all the images for the main menu. I want to do a parallax effect and have the screen zoom into the 'Earth' when players press start in the beginning of the game.



Fig 1.13 - Main Menu Foreground

Fig 1.14 - Main Menu Background

Fig 1.15 - Main Menu Background

Fig 1.16 - Main Menu Midground


Fig 1.17 - Main Menu BG

Fig 1.18 - Simulated Main Menu JPG


To start developing my game, I first imported all my sprite sheets and tilesets into Unity. I then applied a player controller to my player and created a tile palette for my first set of tiles. I also added a collider to the tiles that were placed and the 'MyGround' tag to them. 

Fig 2.1 - Green Forest Tile Palette

Once this was done, I set up the Cinemachine camera and background layers. I initally tried to create a parallax background however it kept jittering everytime the player moved and made it very distracting to play so I removed it. I then created a script to repeat the background when the player gets near the edge of the last image.

Fig 2.2 - Background Repeat Demo

I then added the animations for the player and have it switch depending on the movement of the player.

Fig 2.3 - Player Animations Demo

Fig 2.4 - Current Player Animator Layout

After that, I tried to create a 'fallzone' so if the player falls into the void they would respawn at the checkpoint. I followed this tutorial for respawning the player if it hits the fall zone and this one for the actual checkpoint itself.

Fig 2.5 - Fall Zone (Orange Border)

Fig 2.6 - Checkpoint & Fall Zone Demo

Once that was completed, I added in the short ranged enemy and its animations. I then added a box collider and a script to store its health as well as damage received from the slashpoint. It was at this point that my console kept telling me something was wrong and I spent so. long. trying to figure what it was but I eventually just gave up and left it for another time.

Fig 2.7 - Enemy & Player HP Demo

After I got the HP system for the player and enemy to work, I created a simple 'hit' animation for them both.

Fig 2.8 - Enemy & Player Hit Animations Demo

Then, I added some text above each area to let users learn the controls and player abilities.

Fig 2.9 - Tutorial Text

Now, I had to figure out how to get the enemy to attack the player occasionally. I decided to try copying over the same method as the player attack with assigning a 'hitpoint' to the enemy and adding a box collider that only shows up when the enemy attacks. Then I just added a float for the timing between attacks and a timer.

Fig 2.10 - Enemy Attack Interval Code

Fig 2.11 - Enemy Attack Demo

Afterwards, I created a tile palette for the temple tiles and created another tilemap in the hierarchy for the spikes. For this tilemap, I set up the colliders, enabled 'is Trigger' and tagged it as an obstacle. This would make the player immediately die if they touch the spikes just like the fall zone.

Fig 2.12 - Spike Obstacle Demo


FINAL


Fig 3.1 - Task 3 Game Development Presentation

Done:
- Checkpoint system
- Player controller
- Player animations
- Fall zone
- Short ranged enemy
- HP bar

To Do:
- Main menu
- Long-ranged enemy
- Cutscene intro
- Level 2 & 3
- NPC Interaction
- Loot table for enemy drops


REFLECTION

I've really enjoyed this task so far. It's always been on my to do list to create a game one day and I'm glad that I finally get to accomplish it. While its really tough trying to code in C#, its been really rewarding when I actually understand whats going on. I'm still struggling a lot with the level design as I never play platformers so I'm not sure what is to be expected from players or what makes a good platformer level design.

I've found that I really enjoy coming up with the game plot, worldbuilding and asset development side of creating games rather than coding (shocker). However, coding hasn't been all that bad aside from the console just trolling me for no reason.

Comments

Popular Posts