trident function fixed and collisions broken :(


This week I replaced the placeholder wall objects with a proper tilemap with finalised sprites, and I made a custom rule tile to help me easily make levels. I spent hours and hours trying to find appropriate artwork that I could download and use for my game, and I got so desperate that I started to consider paying money for some assets, because I was finding absolutely nothing that looked right. I finally found a free tilemap sprite from miguelsgp on itch.io that looked mostly like what I wanted, so I downloaded it and created a tile palette out of it, then used those tiles to create my custom rule tile that changes its sprite based on how many tiles are around it and where they are in relation.

I also added in sprites for the spikes and added them to a tilemap so I can put them into the world easier and they line up properly with the walls. I also edited their collider to be slightly smaller than their sprite, to give players a bit of leeway. Below is a showcase of the fact that a player can now walk off a ledge that spikes are on the end of and not die, due to the smaller hitbox.

 

I also attempted to rework my collision detection method, because before it detected if the player was touching the floor by seeing if it was within a small radius of a child game object I placed at the bottom of the collider, but this meant that if the player collider was still on the ground but hanging off so that the child object doesn’t detect the ground, the player wouldn’t be able to jump. The way I attempted to circumvent this issue was to use the onCollision functions in unity to detect if any of the collisions with the walls have a normal that is facing up, i.e. if the collision happens below the player.

I have encountered a bug with this that has stumped me, where the collisions’ normal are sometimes equal to up but sometimes not, and I can’t pin down any sort of pattern.

 

I will ask for help from my tutor for this, and hopefully I can start working on adding the functionality for the mini objectives, adding a proper background and some more sprites, and fine-tuning the camera movement. 

Files

Build.zip Play in browser
May 12, 2024

Leave a comment

Log in with itch.io to leave a comment.