#PLAYER CODE#
left = keyboard_check(ord("A"));
right = keyboard_check(ord("D"));
jump = keyboard_check_pressed(vk_space);
if facing != 0 image_xscale = facing;
else image_xscale = image_xscale;
facing = (right - left);
hsp = facing * walk_spd;
if(place_meeting(x+hsp,y,oWall))
{
while(!place_meeting(x+sign(hsp),y,oWall))
{
x = x + sign(hsp);
}
hsp = 0;
}
if oShotgun.hasFired
{
motion_add(-oShotgun.image_angle, oShotgun.backBlast);
alarm[0] = 1;
hasFired = false;
}
vsp += grv;
if(place_meeting(x,y+vsp,oWall))
{
hasJumped = false;
while(!place_meeting(x,y+vsp,oWall))
{
y = y + sign(vsp);
}
vsp = 0;
}
if jump && !hasJumped
{
hasJumped = true;
vsp -= jump_frc;
}
x += hsp;
y += vsp;
#GUN CODE#
x = oPlayer .x + 30;
y = oPlayer.y;
image_angle = point_direction(x,y,mouse_x,mouse_y);
if mouse_check_button_pressed(mb_left)
{
hasFired = true;
for(i = 0; i < bulletCount; i += 1)
{
instance_create_layer(x,y,"Bullets",oBullet);
}
}
#EXPLANATION#
Yes youre right I only want it to stop happening. So basically I wanna have a significant shotgun knockback and motion_add just seems the best way to do it.
BTW tjanks for all the help :).
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}