init
This commit is contained in:
commit
0556f63d2d
119 changed files with 2908 additions and 0 deletions
37
objects/oblaser/Step_0.gml
Normal file
37
objects/oblaser/Step_0.gml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
lenX = lengthdir_x(8, direction);
|
||||
lenY = lengthdir_y(8, direction);
|
||||
x1 = x + lenX;
|
||||
x2 = x - lenX;
|
||||
y1 = y + lenY;
|
||||
y2 = y - lenY;
|
||||
if collision_line(x1, y1, x2, y2, obSpacestation, true, false)
|
||||
{
|
||||
instance_destroy();
|
||||
}
|
||||
|
||||
|
||||
if collision_line(x1, y1, x2, y2, obEnemy, true, false)
|
||||
{
|
||||
instance_nearest(x, y, obEnemy).shipHealth -= damage;
|
||||
instance_destroy();
|
||||
}
|
||||
if collision_line(x1, y1, x2, y2, obSpaceship, true, false)
|
||||
{
|
||||
if obSpaceship.shipShield >= damage
|
||||
{
|
||||
obSpaceship.shipShield -= damage;
|
||||
obSpaceship.alarm[5] = obSpaceship.shield.shieldDelay * room_speed;
|
||||
}
|
||||
else if obSpaceship.shipShield < damage and obSpaceship.shield > 0
|
||||
{
|
||||
damage -= obSpaceship.shipShield;
|
||||
obSpaceship.shipShield = 0;
|
||||
obSpaceship.alarm[5] = obSpaceship.shield.shieldDelay * room_speed;
|
||||
obSpaceship.shipHealth -= damage;
|
||||
}
|
||||
else
|
||||
{
|
||||
obSpaceship.shipHealth -= damage;
|
||||
}
|
||||
instance_destroy();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue