Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_encounter_bullet_Step_0

(view raw script w/o annotations or w/e)
1
frozen = 0;
2
if (global.interact == 0 || global.interact == 4)
3
    frozen = 0;
4
if (
scr_outside_camera
scr_outside_camera

function
scr_outside_camera(arg0)
{ _offcamera = 0; rightx = x + sprite_width; leftx = x; bottomy = y + sprite_height; topy = y; if (x > (__view_get(e__VW.XView, 0) + __view_get(e__VW.WView, 0) + arg0)) _offcamera = 1; if (rightx < (__view_get(e__VW.XView, 0) - arg0)) _offcamera = 1; if (y > (__view_get(e__VW.YView, 0) + __view_get(e__VW.HView, 0) + arg0)) _offcamera = 1; if (bottomy < (__view_get(e__VW.YView, 0) - arg0)) _offcamera = 1; return _offcamera; } enum e__VW { XView, YView, WView, HView, Angle, HBorder, VBorder, HSpeed, VSpeed, Object, Visible, XPort, YPort, WPort, HPort, Camera, SurfaceID }
(200))
5
    instance_destroy();
6
if (global.interact != 0 && global.interact != 4)
7
    frozen = 1;
8
if (speed != 0)
9
{
10
    fakespeed = speed;
11
    speed = 0;
12
}
13
fakedirection = direction;
14
if (frozen == 0)
15
{
16
    x += lengthdir_x(fakespeed, fakedirection);
17
    y += lengthdir_y(fakespeed, fakedirection);
18
}
19
if (!i_ex(creator))
20
    instance_destroy();
21
image_angle = fakedirection;
22
if (instance_exists(obj_testoverworldenemy) || instance_exists(obj_encounterbasic))
23
{
24
    active = 0;
25
    instance_destroy();
26
}