x = Player.x+1;
y = Player.y+8;
image_angle = point_direction(x,y,mouse_x,mouse_y);
firingdelay = firingdelay - 1;
recoil = max(0,recoil - 1);
if (mouse_check_button(mb_left)) && (firingdelay
{
recoil = 4;
firingdelay = 40;
with (instance_create_layer(x,y,"Attak",oAttak))
{
speed = 1;
direction = other.image_angle + random_range(-3,3);
image_angle = direction
}
if (image_angle > 90) && (image_angle
{
image_yscale = -1;
}
else
{
image_yscale = 1;
}
}
์ง๊ธ ์ง๋์ ์ฝ๋์ธ๋ฐ ์ ๊ธฐ์ ์ด๋ป๊ฒ ๋ฃ์ด์ผ ๊ฒ์ ์๋ก ๋ค์ด์ฌ๋ ธ๋ค๊ฐ ๊ณต๊ฒฉ์ดํํธ์ ๋ง์ถฐ์ ํ๋๋ฅผ ์ ์์๊น??
๊ทธ๋ฆฌ๊ณ ๋์ ์ค์๋ ๋ฌด๊ธฐ๊ฐ ๋ง์ฐ์ค๋ฐ๋ผ ์์์ง์ด๊ฒ ๊ฐ๋ฅํจ??
๊ณต๊ฒฉ์ค์ ๋ํ๋ด๋ ๋ณ์ ํ๋ ์ ์ธํ๊ณ if not ๊ณต๊ฒฉ์ค {image_angle = n} ์ผ์ผ ํด์ค๋ผ, ๊ทธ๋ฆฌ๊ณ ๋ง์ฐ์ค๊ฐ ๋๋ฆฌ๋ฉด ๊ณต๊ฒฉ์ค = true ๋ผ๊ณ ๋ฐ๊ฟ์ฃผ๊ณ ์คํ๋ผ์ดํธ ์ธ๋ฑ์ค ์กฐ์ ์ด๋ ์ด๋ฏธ์ง ์คํผ๋ ์กฐ์ ๋ก ์ ๋๋ฉ์ด์ ์ผ์ฃผ๊ณ ์ ๋๋ฉ์ด์ ์ด ๋๋๋ฉด ๊ณต๊ฒฉ์ค = false ํด์ฃผ์
์นผ์ ๊ฐ๋๋ฅผ ์๋ก ๋ นํํ ์ ๋๋งค์ด์ ์ ํ๋ ๋ง๋ค๊ณ ๊ณต๊ฒฉ ์คํํ ๋ ํญ์ ์ด ์ ๋๋ฅผ ์คํ์์ผ