I wish to be able to create a custom grenade movement for my top down shooter game. So far this is what I have:
Please login to see this attachment.
I managed to implement Method 1
Method 1 (XVel and YVel)
The solution I've made so far uses an XVelocity and YVelocity method to move the grenade about the screen.
- This method makes it easy to bounce the grenade off the walls by simply inverting the XVel or YVel when it comes in contact with a wall.
- This method is a problem because I need to be able to use the player's angle to throw the grenade in an angle at 360 degrees. If there's somehow a way to calculate the XVel and YVel based on the player's angle, that would be great.
Method 2 (Angled Velocity)
- This method makes it difficult to bounce off walls, as I do not know how to bounce off walls using an angle and a velocity.
- This method makes it easy to throw the grenade in the player's angle.
There, those are the two methods. If anyone can help making a solution for either of the two methods where the point is red, that would be awesome! Thanks