Trident Function (Mostly)
This week I worked on and almost finished the trident throwing/recalling mechanics. I also added a script that resets the current scene when the player falls below the camera level, to simulate falling in a pit and dying.
To get the effect of the trident being thrown/recalled, I have place 4 separate game objects in the scene: one for if the trident is being held, one for if the trident is buried in a wall, one for if the trident has just been thrown, and one for if the trident is on its way back to the player. I’ve added a series of scripts to these objects that detect the relevant user input and toggle which object is active and which are inactive so that there is only ever 1 trident object active at any one time. when this active/inactive toggle occurs, I also set the appropriate positions and velocities to get the required function out of the trident.
I have encountered significant difficulty trying to get the trident to be thrown, however, as there doesn’t seem to be any reason why it would not have an initial velocity, but when thrown it just drops straight down due to gravity. There is also an issue with the trident sprite where it is rotated 90 degrees to the right of what I want it to be. I have bypassed this issue for now by just subtracting 90 form all my angle calculations, but I would really like to address this issue as I am concerned that it will cause issues later on.
I’ve also encountered another issue in my game so far, where the trident sprite points correctly at the mouse when the player is facing right, but wrong when the player is facing left. I have an idea on how to fix this and will work on it in the following week.
I am hoping to get some help/advice from my tutor to help resolve these issues, then I will start working on adding the collision detection and logic to make the trident stick into the wall when thrown, as well as adding the hole object at the end of the level to act as a trigger that ends the level. Then if I have time, I will work on adding a spike object that kills the player when they touch it.
These gifs show:
the trident sprite angle problem:
the inability to throw the trident:
the player being able to fall to their death:
and the recall functionality of the trident:
Files
Neptune's Trial
Status | In development |
Author | aspence |
Genre | Platformer, Puzzle |
Tags | 2D, Singleplayer |
More posts
- Updates based upon Testing SessionJun 02, 2024
- Documentation + User GuideMay 31, 2024
- Final fixes ready for testingMay 23, 2024
- Game TestingMay 23, 2024
- Collisions fixed (mostly) and levels madeMay 19, 2024
- trident function fixed and collisions broken :(May 13, 2024
- Player MovementApr 28, 2024
- Game ConceptApr 18, 2024
Leave a comment
Log in with itch.io to leave a comment.