Search code examples
gmlgame-maker-studio-2

Trying To The Player Attack While Moving


I tried all the ways i found and none work please help. I want the player to attack while moving its that simple but i cant do it for some reason. I'm new to Game Maker Language!


Solution

    1. Create a sprite(like a dragon)

    2. create 4 layers of that sprite(1: Stable dragon, 2: Dragon charging breath + ready to flap, 3: dragon firing + flapping, 4: dragon fired + flapped)

    3. create an object for that sprite

    4. create a create event and drag code

    5. use these: image_index = 0; image_speed = 0; + in movement; gravity event( angle -90, power : 1)

    6. Create a global left click event and use this code : if(image_index == 0){image_speed = .3; "create a fireball etc" vspeed = 10; hspeed = 10; }

    7. Create a Animation End event in other and use these :

      image_index = 0; image_speed = 0;

    this is an easy way to make a dragon which moves like a flappy bird while shooting fireballs. You can sample this to create a moving object who shoots.