Windows Melee attack tutorial

Discussion in 'GameMaker Studio 2 Community Tech Support' started by YupYup, Feb 9, 2019.

  1. YupYup

    YupYup Member

    Joined:
    Sep 2, 2017
    Posts:
    30
    Is there some good tutorial for melee attacks ?
    I've seen some, but they were too complicated while i need something simple.
     
  2. BeepBoop

    BeepBoop Member

    Joined:
    Feb 6, 2019
    Posts:
    6
    It depends on what exactly you want to achieve and what type of game you are making.
    Just make a separate object for your weapon, give it its own sprite and check for collision with enemy while attacking.
     
  3. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,304
    If you know how to shoot a bullet, you should also know how to create a melee attack.

    Create an invisible object with a sprite the shape of the melee attack's effective range, and use an alarm to make it self-destruct after a short time. Then check for collisions against that object, and deduct health and destroy it when you detect one. It's the exact same idea as detecting bullet collisions, except it one moves across the screen and the other doesn't.
     
  4. YupYup

    YupYup Member

    Joined:
    Sep 2, 2017
    Posts:
    30
    I will try that, thx.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice