Legacy GM Sword Swing (Dungeon Souls-like

J

jap pagcaliwangan

Guest
I am trying to recreate a weapon swing effect as seen in Dungeon Souls.

However, I am having trouble.

I have a Player_Object which can move around in 2.5D space(Top-Down) and a Weapon_Object.
The Weapon_Object's, for the most part, function is to be the visual representation of the Weapon(s) in the game(ie. sprites,animation) that's why I separated it into a separate object from the Player_Object.

My question is, how do I go about doing a swing animation such as in Dungeon Souls?
 

Kahrabaa

Member
Hello, this is a general idea of how to do it.

Create event:
Code:
wSide=1; //What side is the sword resting on
wMaxAngle=135; //Weapon maximum angle to the side
wAngle=0; //The angle to draw the sword (that will change in game)

Then in the step event
Code:
//You make sure the weapon is aiming towards the mouse + to the side + based on wich side the sword is on
wAngle=point_direction(player.x,player.y,mouse_x,mouse_y) + wMaxAngle * wSide;

//Then when you click, flip the sword to the other side
if(mouse_check_button_pressed( mb_left )){
      switch(wSide){
      case 1:
      wSide=-1;
      break;
      case -1:
      wSide=1;
      break;
      }

      //Here you create the white slash effect object that appears in front of the player and disappears after a moment.
}
Then draw the weapon at wAngle!
 
J

jap pagcaliwangan

Guest
Hello, this is a general idea of how to do it.

Create event:
Code:
wSide=1; //What side is the sword resting on
wMaxAngle=135; //Weapon maximum angle to the side
wAngle=0; //The angle to draw the sword (that will change in game)

Then in the step event
Code:
//You make sure the weapon is aiming towards the mouse + to the side + based on wich side the sword is on
wAngle=point_direction(player.x,player.y,mouse_x,mouse_y) + wMaxAngle * wSide;

//Then when you click, flip the sword to the other side
if(mouse_check_button_pressed( mb_left )){
      switch(wSide){
      case 1:
      wSide=-1;
      break;
      case -1:
      wSide=1;
      break;
      }

      //Here you create the white slash effect object that appears in front of the player and disappears after a moment.
}
Then draw the weapon at wAngle!
so from my understanding, the weapon doesnt actually swing but disappears then reappears and the target angle? and by draw the weapon at wAngle, means I draw it in the draw event?
also, thank you for this.
 
Last edited by a moderator:

Kahrabaa

Member
Yes, thats what it looked like, the slash/sound effect gives the impression of high speed.
Either you draw the sword at the draw event with wAngle or you just set the built in image_angle variable to wAngle. The slash effect could act as a collision mask for colliding with the enemy. This is one way of doing things.
 
Top