M
MIWICP86
Guest
A bit of context - I have been following a bunch of tutorials and playing about with Game Maker to make my own rpg, but had a creative break a while back. Came back to my game to continue working on it and a few bugs have appeared that weren't there before. Please note Game Maker is updated to most recent version.
So here is the bug...
HITBOX SCRIPT
ATTACK STATE
STEP
Also on the Attack State this keeps popping up. If this is the reason for the bug, where do I need to put the variable _hitbox so its mentioned the appropriate amount?
Apologies if I've made any mistakes and if also this is a stupidly easy bug to fix, I'm very new at programming.
Cheers
So here is the bug...
HITBOX SCRIPT
Code:
/// @arg sprite
/// @arg x
/// @arg y
/// @arg angle
/// @arg frames
/// @arg target_array
/// @arg damage
/// @arg knockback
var _sprite = argument0;
var _x = argument1;
var _y = argument2;
var _angle = argument3;
var _frames = argument4;
var _array = argument5;
var _damage = argument6;
var _knockback = argument7;
var _hitbox = instance_create_layer(_x, _y, "Instances", obj_hitbox);
_hitbox.sprite_index = _sprite;
_hitbox.image_angle = _angle;
_hitbox.alarm[0] = _frames;
_hitbox.targets_ = _array;
_hitbox.damage_ = _damage;
_hitbox.knockback_ = _knockback;
return _hitbox;
Code:
/// @description attack state
image_speed = 1;
sprite_index = spr_bogger_attack_right;
set_sprite_facing()
if animation_hit_frame(2) {
var _damage = 1;
var _knockback = 20;
var _life = 2;
var _hitbox = create_hitbox (spr_bogger_grunt_hitbox, x, y+10, [], _life, [obj_idle_up, obj_shield_bubble], _damage, _knockback);
audio_play_sound(a_bogger_attack, 5, false);
}
if animation_hit_frame (image_number - 1) {
state_ = bogger.idle;
sprite_index = spr_bogger_run_right;
alarm[1] = 2 * global.one_second;
}
Code:
depth =- y;
if health_ <= 0 && state_ != enemy.attack {
instance_destroy ();
}
if state_ != noone {
event_user (state_);
}
Apologies if I've made any mistakes and if also this is a stupidly easy bug to fix, I'm very new at programming.
Cheers