Object List

From LOVE

Here is a list of useful objects and descriptions. Variables can be found here.

Parent objects[edit]

p_bouncer[edit]

When the player touches a p_bouncer object it will apply an external horizontal or vertical speed to it, variables (exthSpeed, extvSpeed)

p_death[edit]

When the player touches p_death, they will die and return to their checkpoint

p_slow[edit]

When the player is touching p_slow their vertical speed (vsp) will be set to whatever p_slow's variable "slow" is.

p_solid[edit]

The solid object parent. Used for creating level geometry.

p_water[edit]

When the player is within a p_water region, they can jump infinitely.


Special Objects for Custom Mode[edit]

obj_ckey[edit]

obj_ckey is an object with only one variable, extflag which takes a string. Once the player interacts with the object, it will set all objects that are interactable (p_interact_solid / p_interact_death / p_interact_bounce and their children) to triggered=1.

obj_cswitch[edit]

Similar to obj_ckey, this takes an extflag and triggers all interactable objects with the same extflag. It has an additional variable, trigonce, which can be set to 0 or 1. If set to one, the switch can only be pressed once and will stay pressed.

obj_cdoor[edit]

This is a solid object that when triggered, will either explode, shrink horizontally, or shrink vertically. It is triggered by obj_ckey and obj_cswitch objects with the same extflag.

obj_cdoor variables[edit]

extflag: "default" by default. Set this to a different string in quotations to give it a different trigger variable. type: What happens when triggered. 0: explode | 1: shrink vertically | 2: shrink horizontally wait: how long to wait (in frames) before exploding/shrinking

GML Code for obj_cdoor[edit]

Create Event:

extflag="default"	 //the string variable that should be the name of the door
type=2               //0: explode | 1:shrink vertically | 2:shrink horizontally
con=0                // used as a state machine
timer=0              //increments 1 per frame
wait=5               //how many frames to wait
triggered=0          //whether or not the door has been triggeered


Step Event

if con=0 && triggered
{
    con=1
}

if con=1
{
    timer++
    if timer>=wait
    {
        if type=0    //explode
        {
            if wait>0
                snd_play(snd.bigland)
                
            with obj_player shake=2
            scr_obliterate(c_yellow)
        }
        if type=1    //shrink vertically
        {
            if wait>0
                snd_play(snd.bigland)
            con=2
        }
        if type=2    //shrink horizontally
        {
            if wait>0
                snd_play(snd.bigland)
            con=10
        }
    }
}
if con=2
{
    image_yscale*=.9
    if image_yscale<=.01
    || sprite_height<1
        instance_destroy()
}
if con=10
{
    image_xscale*=.9
    if image_xscale<=.01
    || sprite_width<1
        instance_destroy()
}

obj_ccreator[edit]

obj_ccreator is an interactable style object that when triggered will create an object with the variables that have been provided to it at the x/y value where obj_ccreator was made

GML Code for obj_ccreator[edit]

Create Event

triggered=false
myobj=0
timer=0            				//a variable that increments by one every frame
targ=30            				//how long it takes for the object to move from one location to the next (in frames)
wait=5            				//how long the object should wait before moving again
con=0            				//used as a state varaible.
init=0            				//used to initiate the object
myobj=0							//a reserved variable for referring to the created object
cobj="obj_bouncer_indidivual"   //what kind of object to create
cspr="spr_bouncer_individual"   //what sprite to use (must not be a custom sprite)
extflag="default"    			//the trigger variable for this object
extflag2="default"    			//the trigger variable for the created object
visible=false        			//make this invisible since it's just a controller object

Step Event

if init=0 && triggered
{
    //check to see if the cspr sprite that was defined exists. If not, self destruct to avoid a crash
    if sprite_exists(asset_get_index(cspr))    cspr=asset_get_index(cspr)
    else instance_destroy()
    
    //check to see if the cobj object that was defined exists. If not, self destruct to avoid a crash
    if object_exists(asset_get_index(cobj))    cobj=asset_get_index(cobj)
    else instance_destroy()
    
    myobj=instance_create(x,y,cobj)  //create the cobj, and assign myobj to this.
    myobj.sprite_index=cspr          //give the cobj the cspr
    myobj.image_index=image_index    //set myobj's frame
    myobj.image_speed=image_speed    //set myobj's image speed
    myobj.image_xscale=image_xscale  //set myobj's xscale
    myobj.image_yscale=image_yscale  //set myobj's yscale
    myobj.image_angle=image_angle    //set myobj's angle
    myobj.visible=true               //make sure myobj is set to visible
    myobj.extflag=extflag2           //give myobj the extflag we had as extflag2
    init=1                           //finish initalizing
    instance_destroy()				 //self destruct so we don't do it again
}


obj_cturret[edit]

obj_cturret is an object that creates other objects after a certain number of frames. While it's designed specifically to create bullets that shoot in a direction, it could be used to create other objects.

obj_cturret variables[edit]

  • timer: a timer that increments 1 every frame. You can set this to another number (less than target) to adjust its start time.
  • targ: the time that timer needs to reach to create the object
  • xoff: used to set the relative xoffset variable at which the instance is created
  • yoff: used to set the relative yoffset variable at which the instance is created
  • bulsprite: the sprite that the bullet will be given. default is spr_bullet. This sadly HAS to be an in-game sprite, not a custom one.
  • bulspeed: the speed which the bullet will travel
  • mapanim: whether or not to map the animation of the turret to the progress of the firing rate
  • bulobj: what object to create. default is obj_bullet.

obj_cturret example[edit]

{
	"type": "obj_cturret",              ←define the object
	"sprite_index": "spr_lv14_shootUp", ←define the sprite (can be custom)
	"image_angle": 180,                 ←define the direction of the object
	"targ": 20,                         ←define how often it shoots (once per 20 frames)
	"bulsprite": "spr_3x3Bullet",       ←define the sprite of the bullet (cannot be custom)
	"x" : 44,                           ←define the x location of the turret
	"y" : 39,                           ←define the y location of the turret
	"xoff" : 0;                         this sprite does not require an x offset, but this is where it'd go
	"yoff" : 0                          this sprite does not require a y offset, but this is where it'd go
},

Result:

GML Code for obj_cturret[edit]

Create Event

timer=0    				//a value that raises by one every frame.
targ=30    				//the value that timer has to reach before creating the bullet object
xoff=0    				//a relative xoffset for where the bullet is created
yoff=0    				//a relative yoffset for where the bullet is created
bulspeed=1        		//the speed of the bullet
mapanim=true    		//whether or not to map the sprite animation to the progress of timer to targ
bulsprite="spr_bullet"  //the sprite of the bullet, initialized as a string because it will search for the asset
bulobj="obj_bullet"     //the object that the turret will create when timer reaches targ
init=0                  //used for an initialization step to let Game Maker catch up on the first frame.

Step Event

if init=0    //initialization only happens once per object
{
    if sprite_exists(asset_get_index(bulsprite))
        bulsprite=asset_get_index(bulsprite)        //find the bullet sprite and assign it
    else    instance_destroy()                        //if it doesn't exist, destroy this obj so the game doesn't crash
    
    if object_exists(asset_get_index(bulobj))        //find the bullet object and assign it
        bulobj=asset_get_index(bulobj)
    else    instance_destroy()                        //if it doesn't exist, destroy this obj so the game doesn't crash
	
    init=1	//finish init
}
timer++    		//increment the timer variable one every frame
if mapanim		//if mapanim is true, the sprite will map its animation to the progress of timer divided by targ. Otherwise, use image_speed
{
    image_index=lerp(0,sprite_get_number(sprite_index),timer/targ)
}
if timer>=targ    //once timer has reached the target time, create the bullet
{
    timer=0    						//reset the timer so we can repeat this
    var bul=instance_create(x+lengthdir_x(round(sprite_width/2),image_angle)+xoff,y+lengthdir_y(round(sprite_height/2),image_angle)+yoff,bulobj)    //create the bullet instance at the x/y offset.
    bul.image_xscale=1
    bul.image_yscale=1
    bul.direction=image_angle+90    //set the direction of the bullet
    bul.speed=bulspeed              //set the speed of the bullet
    bul.sprite_index=bulsprite      //set the sprite of the bullet
}

obj_cmover[edit]

obj_cmover is an object for LOVE Custom that creates an object with custom variables, sets two pairs of x/y coordinates, and them moves between them over time. Sadly this cannot use a custom sprite due to inheritance.

obj_cmover Variables[edit]

  • timer: a timer that increments 1 every frame. You can set this to another number (less than target) to adjust its start time.
  • targ: the time that timer needs to move from one point to the next
  • locx1: the starting x location of the object. Set to X by default, so not needed unless you want it for some weird reason.
  • locy1: the starting y location of the object. Set to Y by default, so not needed unless you want it for some weird reason.
  • locx2: the target x location of the object's destination.
  • locy2: the target y location of the object's destination.
  • cobj: the object index of the object we'll be creating.
  • cspr: the sprite index of the object we'll be creating. This cannot be a custom sprite. Sorry.

obj_cmover Example[edit]

{
	"type" : "obj_cmover",
	"x" : 66,
	"y" : 45,
	"locx2" : 119,
	"locy2" : 45,
	"targ"    : 53,
	"image_speed" : 1,
	"cobj" : "p_death",
	"cspr" : "spr_lv20_smasher"
},

Result:

GML Code for obj_cmover[edit]

Create:

locx1=x            				//the first location's x. set to xstart by default
locy1=y            				//the first location's y. set to xstart by default
locx2=x+20         				//the second location's x
locy2=y+20         				//the second location's y
timer=0            				//a variable that increments by one every frame
targ=30            				//how long it takes for the object to move from one location to the next (in frames)
wait=5             				//how long the object should wait before moving again
con=0            				//used as a state varaible.
init=0            				//used to initiate the object
myobj=0            				//a reserved variable for referring to the created object
cobj="obj_bouncer_indidivual"   //what kind of object to create
cspr="spr_bouncer_individual"   //what sprite to use (must not be a custom sprite)
visible=false                   //make this invisible since it's just a controller object

Step:

if init=0
{
    //check to see if the cspr sprite that was defined exists. If not, self destruct to avoid a crash
    if sprite_exists(asset_get_index(cspr))    	cspr=asset_get_index(cspr)
    else 										instance_destroy()
    
    //check to see if the cobj object that was defined exists. If not, self destruct to avoid a crash
    if object_exists(asset_get_index(cobj))    cobj=asset_get_index(cobj)
    else instance_destroy()
    
    sprite_index=cspr    			//this is redundant but I set the sprite index here
    myobj=instance_create(x,y,cobj) //create the cobj, and assign myobj to this.
    myobj.sprite_index=sprite_index //give the controller object's sprite to myobj
    myobj.image_index=image_index   //set myobj's frame
    myobj.image_speed=image_speed   //set myobj's image speed
    myobj.image_xscale=image_xscale //set myobj's xscale
    myobj.image_yscale=image_yscale //set myobj's yscale
    myobj.image_angle=image_angle   //set myobj's angle
    myobj.visible=true              //make sure myobj is set to visible
    init=1                          //finish initalizing
}

if !i_ex(myobj) instance_destroy()    //if for some reason myobj is destroyed, self destruct this controller


if con=0
{
    timer++
    
    myobj.x=round(lerp(locx1,locx2,timer/targ))    //set the x based on timer/targ
    myobj.y=round(lerp(locy1,locy2,timer/targ))    //set the y based on timer/targ
    
    if timer>=targ
    {
        myobj.x=locx2    //just in case someone does something funky, put it where it's supposed to go
        myobj.y=locy2
        timer=0            //reset the timer
        con=1            //move to the next step
    }
}

if con=1
{
    timer++
    if timer>=wait    //here we just wait until the timer meets wait
    {
        timer=0
        con=2
    }
}

if con=2    //same as before, but in reverse
{
    timer++
    
    myobj.x=round(lerp(locx2,locx1,timer/targ))
    myobj.y=round(lerp(locy2,locy1,timer/targ))
    
    if timer>=targ
    {
        myobj.x=locx1
        myobj.y=locy1
        timer=0
        con=3
    }
}

if con=3    //wait again, then restart the steps.
{
    timer++
    if timer>=wait
    {
        timer=0
        con=0
    }
}

obj_cdanmaku[edit]

obj_cdanmaku is an object for LOVE Custom that creates a spray of objects, similar to a bullet hell game.

obj_cdanmaku variables[edit]

  • range: by default these will create in a full circle
  • count: how many bullets to make
  • timer: incrementing time variable
  • targ: how frequently to create a bullet
  • rotspeed: how much the angle will increment per frame
  • bulangle: the start angle of the bullets
  • bulobj: what object to create
  • bulsprite: what sprite for the bullet to use. Has to be a built in sprite. Sorry.
  • bulspeed: how fast the bullets will generate
  • startdist: how far from the x/y to generate the bullet
  • mapanim: whether or not to map the sprite animation to the progress of the bullets
  • mapangle: whether or not to map the angle of the sprite to the bullet angle

obj_cdanmaku example[edit]

{
	"type" : "obj_cdanmaku",
	"x" : 492,
	"y" : 82,
	"count": 4,
	"rotspeed" : 2,
	"targ" : 2,
	"bulspeed" : 2
},

Result:

GML Code for obj_cdanmaku[edit]

Create Event:

range=360               //by default these will create in a full circle
count=6                 //how many bullets to make
timer=0                 //incrementing time variable
targ=10                 //how frequently to create a bullet
rotspeed=1              //how much the angle will increment per frame
bulangle=0              //the start angle of the bullets
bulobj="obj_bullet"     //what object to create
bulsprite="spr_bullet"	//what sprite for the bullet to use
bulspeed=1              //how fast the bullets will generate
startdist=5             //how far from the x/y to generate the bullet
mapanim=0               //whether or not to map the sprite animation to the progress of the bullets
mapangle=0              //whether or not to map the angle of the sprite to the bullet angle
init=0                  //initialization variable

Step Event:

if init=0    //initialization only happens once per object
{
    if sprite_exists(asset_get_index(bulsprite))
        bulsprite=asset_get_index(bulsprite)        //find the bullet sprite and assign it
    else    instance_destroy()                        //if it doesn't exist, destroy this obj so the game doesn't crash
    
    if object_exists(asset_get_index(bulobj))        //find the bullet object and assign it
        bulobj=asset_get_index(bulobj)
    else    instance_destroy()                        //if it doesn't exist, destroy this obj so the game doesn't crash
    init=1
}


if mapanim    //if mapanim is true, the sprite will map its animation to the progress of timer divided by targ. Otherwise, use image_speed
&& sprite_exists(sprite_index)
{
    image_index=lerp(0,sprite_get_number(sprite_index),timer/targ)
}

bulangle+=rotspeed

if mapangle 
&& sprite_exists(sprite_index)
    image_angle=bulangle

timer++
if timer=targ
{
    for (var i = 0; i < count; ++i) 
    {
        var bul=instance_create(x+round(lengthdir_x(startdist,bulangle+(range/count)*i)),y+round(lengthdir_y(startdist,bulangle+(range/count)*i)),bulobj)
        
        bul.sprite_index=bulsprite
        bul.direction=bulangle+(range/count)*i
        bul.speed=bulspeed
    }
    timer=0
}

Object Lists Per Level[edit]

LOVE (2014)[edit]

Level 01
Level 02
Level 03
Level 04
Level 05
Level 06
Level 07
Level 08
Level 09
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16
Level 17

LOVE 2: kuso[edit]

Level 01
Level 02
Level 03
Level 04
Level 05
Level 06
Level 07
Level 08
Level 09
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16
Level 17
Level 18
Level 19
Level 20
Level 21
Level 22
Level 23
Level 24
Level 25

LOVE Remastered[edit]

Level 01
Level 02
Level 03
Level 04
Level 05
Level 06
Level 07
Level 08
Level 09
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16

LOVE 3[edit]

Level 01
Level 02
Level 03
Level 04
Level 05
Level 06
Level 07
Level 08
Level 09
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16
Level 17
Level 18
Level 19
Level 20
Level 21
Level 22
Level 23
Level 24
Level 25

<3[edit]

Level 01
Level 02
Level 03
Level 04
Level 05
Level 06
Level 07
Level 08
Level 09
Level 10
Level 11
Level 12
Level 13
Level 14
Level 15
Level 16
Level 17
Level 18
Level 19
Level 20

Useful objects[edit]

obj_marker[edit]

Used for graphical purposes. Has no code attached to it. Can be used for things like decor.

obj_goal[edit]

Created by default within the config.json, but you can create other obj_goal areas in a level to trigger the end of a stage.

obj_teleporter[edit]

When the player touches obj_teleporter they will be warped to the object's targX and targY variables.

Other Objects[edit]

For a full list of every object in the game, visit the Full Object List.