How do I Stop my character to use a weapon?

Get help using Construct 2

Post » Sun Apr 02, 2017 8:33 pm

While my character runs and swings his sword it shows the 'attack" animation but his feet to not move. Instead he slides. I guess this is because I need an animation that has him running while attacking. So instead of that I want him to stop and swing the sword, (like in Castlevania Simon Belmont will stop moving to swing the whip.) I'm trying to make an event that says: If the mouse is clicked and the direction arrow is pressed, stop moving, play "attack" animation. But since I am new to C2 I don't know what you call the "If" statements.
B
4
Posts: 8
Reputation: 216

Post » Sun Apr 02, 2017 10:06 pm

Hate to break it to you bud but Simon can't attack while walking. The thing with Castlevania is once you decide to do an action, you have to commit to it.

What sets Castlevania apart from other similar Melee Action games (Zelda 2: Adventure of Link, Ninja Gaiden) is that there is no control over Simon once he jumps (can't control mid-air velocity) and attacks (has to go through the cycle of drawing back and whipping). Doesn't matter how fast your reaction time is.

Simon Sprite Sheet: https://www.spriters-resource.com/nes/cv/sheet/8477/

Now it's easy enough if the game were like Ninja gaiden since Ryu only has a 2-frame run cycle.
I suggest you check out the sprite sheets of all these characters to understand how they play.
Heck, the games can be played in online browsers now. They're worth revisiting.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Apr 02, 2017 11:04 pm

No you're going about this wrong.

Stopping to attack
_________________________
On Right Arrow Pressed > Move Character
X On Left Mouse Button Down > Set Animation " Walk "
_________________________

Attacking while running
_________________________
On Right Arrow Pressed > Move Character
On Left Mouse Button Down > Set Animation " Walk_Attack"
________________________

@MPPlantOfficial https://www.youtube.com/watch?v=z4jeREy7Pbc
You can do anything.
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Mon Apr 03, 2017 1:23 am

Use a global variable trigger.

When you are not attacking set it to a number and when you are attacking set it to a different number.

On Key Press Left: Set animation player to "walk"
Movement=1

On Key Press Attack: Set Movement=0

On Movement=0: Set animation "Attack
............................. Wait X seconds
............................. Set Movement=1

That way your player will not move when attacking.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Mon Apr 03, 2017 10:20 am

lamar wrote:Use a global variable trigger.

When you are not attacking set it to a number and when you are attacking set it to a different number.

On Key Press Left: Set animation player to "walk"
Movement=1

On Key Press Attack: Set Movement=0

On Movement=0: Set animation "Attack
............................. Wait X seconds
............................. Set Movement=1

That way your player will not move when attacking.


Yeah the animation stops but when I press the right arrow while attacking the player still slides left and right just no walking animation.
B
4
Posts: 8
Reputation: 216

Post » Mon Apr 03, 2017 10:40 am

kccarmea wrote:
lamar wrote:Use a global variable trigger.

When you are not attacking set it to a number and when you are attacking set it to a different number.

On Key Press Left: Set animation player to "walk"
Movement=1

On Key Press Attack: Set Movement=0

On Movement=0: Set animation "Attack
............................. Wait X seconds
............................. Set Movement=1

That way your player will not move when attacking.


Yeah the animation stops but when I press the right arrow while attacking the player still slides left and right just no walking animation.


What movement control are you using?

You can set controls to disabled for platformer and 8 direction movement control.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790


Return to How do I....?

Who is online

Users browsing this forum: beohs, Blendi1223, Elliott, MadSpy and 11 guests