Users browsing this thread: 1 Guest(s)
Help with attack script (GM: Studio 1)
#1
I'm making an Action Platform Game (but I 'm working to other projects too), and I'm using Game Maker: Studio 1. I'm trying to make my character can attack both when is walking/standing and/or when is jumping/fall. The stand attack animation works well, it's animated, but the jumping attack isn't animated (despite I've add frames). Here is the script:

Code:
if(place_meeting(x,y+1,obj_wall)){
grounded = true
}else{
grounded = false
}

if(grounded){
sprite_index = spr_walk
} else {
if(vspeed<0){
sprite_index = spr_jump
}else{
sprite_index = spr_jump
}
}

if attack = 1 //Attack var is actived when the player presses attack button
if grounded = true
{
sprite_index = spr_attack
hspeed = 0
image_speed = .2
}
else if grounded = false
{
sprite_index = spr_attack_jump
image_speed = .2
}


This is what happens when my character attacks when jumping/falling: https://imgur.com/a/l6QR2RN (I did't make the sprites, they are from Castlevania. I use sprite from other games for my prototypes, but then I make my original sprites). As you can see, spr_attack_jump isn't animated, just spr_attack (the standing/walking attack animation). What I did wrong? Do you know how to fix it?
Reply
Thanked by:


Messages In This Thread
Help with attack script (GM: Studio 1) - by MagicFool64 - 07-23-2019, 02:41 PM

Forum Jump: