Grenade Movement Top Down

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • 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 :D

  • I've edited your example:

    Please login to see this attachment.

    X Velocity is based on: Cos( ShootAngle ) * Speed
    Y Velocity is based on: Sin( ShootAngle + 180 ) * Speed

    - BartekB

    Join the Click Converse Discord! - Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!