var sfx; sfx = instance_create(__x, __y, obj_specialeffect); sfx.sprite_index = spr_lowhit; curhp -= other.damage; last_damage += other.damage; last_damage_timer +=5; if other.type == 'juggle' {motion_set(90, 8)} } with (other.id){instance_destroy()} Since the hitbox is given the variables "damage" and "type". We can indicate that the player colliding with the hitbox should be 1) damaged by 5, and 2) hit into the air. Edit script: ini_player Add these two lines to the script: last_damage = 0; last_damage_timer = 0; Edit script: scr_gravity Edits are indicated in RED. var gforce; gforce = 0.5; if y >= ground {if vspeed > 0{vspeed = 0}; y = ground; onground = true} if y < ground {motion_add(270, gforce); onground = false} RUN! Try high kicking! The guy pops into the air ! Man this is looking to be one hell of a 2D Fighter ! How much more could we do? What else do can we implement into this game?? Much, much more guys. But it really is up to you how far you want to take this! Juggling No Attacking So I was playing around with juggling the last game and I quickly discovered a problem that I wanted to solve. While juggling the opponent, I found that the other player could still attack while in the air! I didn't like that. If I hit someone into the air, there should be a refractory period in which the other player is left helpless. So how are we going to implement this "refractory period"? Simply, we need a timer in the player. A 'juggle' timer.
var sfx; sfx = instance_create(__x, __y, obj_specialeffect); sfx.sprite_index = spr_lowhit; curhp -= other.damage; last_damage += other.damage; last_damage_timer +=5; if other.type == 'juggle' {motion_set(90, 8)} } with (other.id){instance_destroy()} Since the hitbox is given the variables "damage" and "type". We can indicate that the player colliding with the hitbox should be 1) damaged by 5, and 2) hit into the air. Edit script: ini_player Add these two lines to the script: last_damage = 0; last_damage_timer = 0; Edit script: scr_gravity Edits are indicated in RED. var gforce; gforce = 0.5; if y >= ground {if vspeed > 0{vspeed = 0}; y = ground; onground = true} if y < ground {motion_add(270, gforce); onground = false} RUN! Try high kicking! The guy pops into the air ! Man this is looking to be one hell of a 2D Fighter ! How much more could we do? What else do can we implement into this game?? Much, much more guys. But it really is up to you how far you want to take this! Juggling No Attacking So I was playing around with juggling the last game and I quickly discovered a problem that I wanted to solve. While juggling the opponent, I found that the other player could still attack while in the air! I didn't like that. If I hit someone into the air, there should be a refractory period in which the other player is left helpless. So how are we going to implement this "refractory period"? Simply, we need a timer in the player. A 'juggle' timer.
Fighting%20Game%20Tutorial.docx