The projectile in the game refuses to turn left

skofrant

Member
I have a problem, the projectile in the game does not turn left. Shoots Right No matter if the player turns left or right, the projectile only shoots right.


obj_projectile

draw


GML:
draw_sprite_ext(sprite_index, image_index, round(x), round(y), image_xscale, image_yscale, image_angle, image_blend, image_alpha);

obj_player

step


GML:
var cur = obj_game_controller.current_weapon; // the control object have the index of the current weapon, so we need to fetch that first

if keyboard_check_pressed(ord('X')) && attClock <= 0 &&  inAir=false &&
(global.wep[cur,e_wep.ammo] > 0 || global.wep[cur,e_wep.ammo] == -1) {




attClock = global.wep[cur,e_wep.firerate];



attClock = 20;
curAttack =1;


with instance_create(x,y,par_attack) {
sprite_index = spr_player_attack;
image_xscale = other.image_xscale;


}

    var box, ID;
    if image_xscale == -1
        box = bbox_left;
    else
        box = bbox_right;


if (global.wep[cur,e_wep.ammo] >= 1) // if not infinite ammo
{
global.wep[cur,e_wep.ammo]-=1;


}


var ins = instance_create(x+(image_xscale*42), y-17,global.wep[cur,e_wep.ammo_type] );
ins.hspeed = image_xscale * 15;
ins.dmg = irandom_range(global.wep[cur,e_wep.dmg_min],global.wep[cur,e_wep.dmg_max]);
audio_play_sound(global.wep[cur,e_wep.ammo_sound],10,false)

}


Thank you for any help and suggestion
 

skofrant

Member
I have nothing in the steppe of the projectile..I have only a event draw and in a collision with a wall that is about to destroy itself.
 
Top