Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Help with a script (GM: Studio 1)

A topic by MagicFool created Jul 19, 2019 Views: 345 Replies: 2
Viewing posts 1 to 2

Am I writing in the right category for asking help?

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:

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

if(grounded){                   
    sprite_index = spr_walk                               // When the character isn't moving, the image_speed is set to 0
} else {
    if(vspeed<0){               
        sprite_index = spr_jump
    }else{                      
        sprite_index = spr_jump                            //I'm using the same sprite for the fall :P
    }
}

if attacca = 1
    if grounded = true
        {
        sprite_index = spr_attack
        image_speed = .2
        }
    else if grounded = false
        {
        sprite_index = spr_attack_jump
        image_speed = .2
        }

What I did wrong?

Moderator (1 edit)

For things like this I'd recommend you ask on yoyogames official forum, or the GameMaker subreddit. While there are quite a few people who use GameMaker here, you have a much better chance of getting an answer on a specialized forum

Thanks