GML
//function: player attack a player
globaltemp = readushort();//get getting attackED playerid
globaltemp1 = readushort();//get sending attack playerid
global.GDMG = readbyte();
with (obj_player)
{
if (globaltemp == playerid)
{
i=instance_create(obj_player.x,obj_player.y,obj_shot);
i.DMG = global.GDMG
rep = false
alarm[5] = 60
with (obj_other)
{
if (globaltemp1 == playerid)
{
direction = point_direction(x,y,obj_player.x,obj_player.y);
scr_direction();
i =instance_create(x,y,obj_laserO);
}
}
}
else
with (obj_other)
{
if (obj_player.cible == globaltemp)
{
d =instance_create(x,y,obj_Sshot);
d.DMG = global.GDMG
}
if (globaltemp == playerid)
{
global.cibleIx = x
global.cibleIy = y
with(obj_other)
{
if (globaltemp1 == playerid)
{
i = instance_create(x,y,obj_laserN);
i.cibleIx = global.cibleIx;
i.cibleIy = global.cibleIy;
}
}
}
}
}
lukaj , niechce mi dzialac , to nie wszystko
sa do tego 3 lasery, kazdy ma move_towards_point , ten sie tworzy gdy ktos do mnie strzeli , ale nie dziala ;/ a w debug mode nie pokazuje nowej instancji
image_angle = point_direction(x,y,obj_player.x,obj_player.y);
move_towards_point(obj_player.x,obj_player.y,40);