Repository navigation
User Manual: Objects
Important
You can define the properties of the objects when you place the object in the rooms on their creation code, or if the object is not meant to be placed on the room, you can set the properties when creating instances with instance_create_depth() function.
Warning
This documentation doesn't who all the properties (variables) the object has, just the properties that you are allowed to edit and interact with, the others are not important for creating stuff and are often just flags or auxiliar control flow properties for the object to trigger and execute its function correctly. Keep in mind you can still use the default properties objects come with, like depth, sprite_index and others.
This object is a collision that you can place in the overworld rooms to prevent other objects (like players) to traverse on the area it covers, useful for enclosing areas of rooms so the player or entities don't go out of bounds and for pushable objects to also not go out of some areas, etc.
Note
Players always collide with collisions with collision_id = 0, changing the number makes it so the collision doesn't interact with the player.
Properties:
-
collision_id = 0- Integer: ID given to collision to define what can collide with it, other objects can then be defined which collisions they can collide with by the given IDs of them, it's 0 by default.
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the collision itself or other objects, it's undefined by default so it does nothing. -
when_colliding = undefined: Method that executes whenever the player collides with this object collision, it's undefined by default so it does nothing.
This is an interactible NPC/entity object that can be manipulated to do several interactions with the player, from moving around the rooms, having different sprites, trigger small events, etc. Its main purpose is to be an interactible NPC that usually has dialog to display and interactions.
Properties:
-
collision_ids = [0]- Array of Integers: List of collision IDs which the object can collide with, if the ID is not in the list, the collision will be ignored and won't collide with this entity. -
can_player_push = false- Boolean: Defines if the player can push this entity (like rocks for a puzzle). -
can_entities_push = false- Boolean: Defines if other entities can push this entity (like a chain of rocks pushing each other). -
can_push_entities = false- Boolean: Defines if this entity can push other entitites that are have theircan_entities_pushproperty set to true, if they have it set to false, they will act as a wall instead. -
can_overlap = false- Boolean: Defines if other entities that get pushed or placed on top of this entity can overlap on it, staying inside without problems, if false it acts as a wall to them.
Note
If can_entities_push is true, it will be pushed around by other entities until it has no valid pushing area, in which the pushing entity will being to overlap with this entity.
-
can_player_collide = true- Boolean: Defines if the player can collide with this entity, if false all colliding interactions with this entity and the player are ignored (no pushing by the player even if set to true) and the player can pass through it. -
round_collision_behavior = false- Boolean: Defines the type of collision the entity has, if true then the collision is an oval behavior one instead, harder to push around consistently.
Tip
Use this property when the collision of the sprite assigned to the entity has an oval type collision.
-
can_interact = true- Boolean: Defines if the player can interact with the entity with the definedinteraction_keyproperty, triggering theinteractionmethod property, useful in case for some reason you cannot stop triggering the interaction event even when the player doesn't want to keep interacting with it. -
depth_ordering = true- Boolean: Defines if its depth property should always be defined by its Y position in the room, giving a sense of depth to the object, if false, it won't do that and you can set the depth that you desire, often used like that for pressure plates and other objects that are on the floor, always below other objects. -
interaction_key = "confirm"- String: Defines the key you can use to trigger theinteractionmethod property, it can only be "confirm", "cancel", "menu" or a single character between "" so anord()function can parse it for use.
Methods:
-
before_step = undefined: Method that executes before every step of the game, used to do some game logic on the entity itself or other objects, it's undefined by default so it does nothing. -
step = undefined: Method that executes every step of the game, used to do some game logic on the entity itself or other objects, it's undefined by default so it does nothing. -
after_step = undefined: Method that executes after every step of the game, used to do some game logic on the entity itself or other objects, it's undefined by default so it does nothing. -
before_draw = undefined: Method that executes every step of the game before the draw event, used to draw stuff on screen at the depth level of the entity object, it's undefined by default so it does nothing. -
draw = undefined: Method that executes every step of the game on the draw event, used to draw stuff on screen at the depth level of the entity object, it's undefined by default so it does nothing. -
after_draw = undefined: Method that executes every step of the game after the draw event, used to draw stuff on screen at the depth level of the entity object, it's undefined by default so it does nothing. -
interaction = undefined: Method that executes whenever the player presses the interaction key defined touching this entity, it's undefined by default so it does nothing. -
when_colliding = undefined: Method that executes whenever the player collides with this object entity, it's undefined by default so it does nothing.
The object interaction is like a collision that you can interact with by pressing an interaction key, it shares some properties from the collision object and the entity object, its main purpose it's just be a wall you can interact with and trigger events, not an entity that can move around.
Properties:
-
can_player_collide = true- Boolean: Defines if the player can collide with this interaction object, if false the player can pass through it then. -
can_entities_collide = true- Boolean: Defines if entity objects can collide with this interaction object, if false the entities can pass through it then. -
can_interact = true- Boolean: Defines if the player can interact with the entity with the definedinteraction_keyproperty, triggering theinteractionmethod property, useful in case for some reason you cannot stop triggering the interaction event even when the player doesn't want to keep interacting with it. -
interaction_key = "confirm"- String: Defines the key you can use to trigger theinteractionmethod property, it can only be "confirm", "cancel", "menu" or a single character between "" so anord()function can parse it for use.
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the object itself or other objects, it's undefined by default so it does nothing. -
interaction = undefined: Method that executes whenever the player presses the interaction key defined touching this interaction object, it's undefined by default so it does nothing. -
when_colliding = undefined: Method that executes whenever the player collides with this interaction object, it's undefined by default so it does nothing.
This is a special object in the overworld which can be used to mark the spawn point the player should spawn at whenever changing between rooms or loading save points, save points and room transitions require a spawn point object to exist so they can spawn the player in that spot.
Important
It has no properties or methods, it's purpose is to be an indicator of where in the room the player should spawn in, the direction of this object indicates in which facing direction the player will be looking at when spawining in it. The sprite it uses has 2 subimages which you can specify when placing the object in the room, these change the behavior in which the spawn point does stuff for spawning the player, usually you use the first subimage for the save points and the second for room transitions, although you can use whichever you wish (for save point actually it makes no difference).
The object trigger is used to trigger events, dialogues and stuff whenever the player collides with them.
Caution
it has a mandatory method which you should always define when placing them on rooms or creating them as these will trigger that event always when colliding, not defining it will result in error.
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the object itself or other objects, it's undefined by default so it does nothing. -
trigger_function- MANDATORY: Method that executes whenever the player collides with it, it's obligatory that you define this method or risk an error crashing your game.
The most important object of the game, the overworld player object, this object is the core of the interactions in the overworld, the users interact and move around the player to do all the game.
Important
The object player's movement animation and movement itself is being handled as if it was in a 30 FPS enviroment, althought the game runs at 60 FPS, this decision was made so so the "Frisk dance" feature looked nice as in 60 FPS it looked bad.
These object has special requirements:
- Must have a sprite assigned that has a designated amount of subimages to represent all sides the player can look at, the amount of subimages is 4 times the amount specified in the
animation_framesproperty, by default it'ssubimages_amount/4, so if you have 4 frames of animation per side, your sprite must have 16 subimages, every group of animation following the order Down, Right, Up, Left, like this:
- This object must always be present at all times, on battles on overworld, the only exception is on the Game Menu, make sure the player is created when exiting the Game Menu.
Properties:
-
frisk_dance = true- Boolean: Defines if the "Frisk dance" is possible to perform, this movement glitch consists of pressing Up and Down at the same time against a collision upwards, which makes the player jitter in place up and down changing directions every 2 frames (60 FPS). -
moon_walk = true- Boolean: Defines if the "Moon walk" is possible to perform, this movement glitch consists of pressing Right while Left is being held down, making the player not change direction and therefor walking backwards towards the right, doing a moon walk move. -
can_run = true- Boolean: Defines if the player is able to run by holding down the Cancel button (being the X key or Shift). -
round_collision_behavior = false- Boolean: Defines if the collision of the player should behave like a round collision or not.
Tip
Use this property when the collision of the sprite assigned to the entity has an oval type collision.
-
can_collide = true- Boolean: Defines if the player can collide with collisions, if false, it ignores all collisions and can pass through them (can't push entities even if they are pushable), this doesn't mean it cannot interact with stuff by pressing the action keys on the objects.
Tip
when performing cutscenes that happen in other rooms, it is recommended you set this to false so the player stays in place and you can set its image_alpha to 0, until you come back to the main room and you return the control to the player.
-
can_open_menu = true- Boolean: Defines if it can open the menu pressing the Menu key (being C or Control key), if false, it can't open the menu, useful for when you are in a persecution scene and shouldn't allow the player to close their menu. -
bubble_warning_sprite_index = 0- Integer: Defines the subimage index of the spr_player_bubble_warning_sign sprite to use when entering random encounters, by default there are only 3, so numbers between 0 to 2 inclusive will have different sprites, but you can add more by editing the sprite resource of it.
-
movement_speed = 6- Integer: Movement speed in pixels the player is able to move (remember it moves the amount every 2 frames as it's replicating a 30 FPS enviroment on a 60 FPS game), the rooms are usually by default 640x480, so 6 is the default speed every 2 frames the player moves in these rooms, if your rooms are 320x240 and just viewing them in double size you might want to change this number to 3 or the number of your licking. -
movement_run_speed = 9- Integer: Movement speed in pixels the player is able to move while running (remember it moves the amount every 2 frames as it's replicating a 30 FPS enviroment on a 60 FPS game). -
animation_speed = 6- Integer: The animation speed in which the frames of the walking animation change (remember the animation speed is also replicating a 30 FPS enviroment on a 60 FPS game, so the number you place will actually be the double of that, 6 will be actually 12 frames to change frames of the animations). -
animation_run_speed = 4- Integer: The animation speed in which the frames of the running animation change (remember the animation speed is also replicating a 30 FPS enviroment on a 60 FPS game, so the number you place will actually be the double of that, 4 will be actually 8 frames to change frames of the animations). -
walk_sprite- MANDATORY Sprite resource reference: Obligatory sprite resource reference that complies with the requirements previously established and that will be used for the player itself moving around the rooms, not compling with the requirement may risk crashing the game with an error. -
run_sprite = undefined- Sprite resource reference: Optional sprite resource reference that complies with the requirements previously established and that will be used for the player whenver it is running, not compling with the requirement may risk crashing the game with an error. -
animation_frames = sprite_get_number(walk_sprite)/4- Integer: Amount of animation frames the walking and running sprite have for every direction the player can move to, being 4 directions always, not specifying correctly the number of frames of the sprite may risk crashing the game with an error. -
spawn_point_reference = noone- Spawn Point instance reference: Property that must be defined with a spawn point reference to the room you are changin to whenever you change rooms manually usingroom_goto()function, not doing so will have the player stay in the absolute coordinates of the room, which may be a good or bad thing depending of your needs.
Methods:
-
player_sprite_reset- DO NOT MODIFY: Method used to reset the player's sprite and set the direction it will look at.- Parameters:
-
_direction = 0- Integer: Direction the player will be facing, it takes numbers between 0 and 3 inclusive, representing 0 - Down, 1 - Right, 2 - Up, 3 - Left.
-
- Parameters:
-
player_anim_stop- DO NOT MODIFY: Method used to reset the player's sprite's current animation, keeping the direction it's facing, call without parameters.
Item box which you can place around so the player has a box where they can place items inside for later use or storing.
The properties and methods of this object are the same as the entity object, only one is added to the object for its specific behavior, the interaction method is already defined as well, DO NOT MODIFY IT.
Properties:
-
box_inventory_id = 0- Integer: This is the ID of the Box list of items that the box is connected to, there can be more than one item box list, check out Game configuration and settings for more information on it, defaults to 0, the main box.
The iconic save point where the player can fully heal their HP and save the game.
The properties and methods of this object are the same as the entity object, only one is added to the object for its specific behavior, the interaction method is already defined as well, DO NOT MODIFY IT.
Properties:
-
spawn_point_instance- MANDATORY Spawn Point instance reference: Spawn point instance reference used for the save point to save the game and spawn the player in there when the game is loaded back to the save file, MUST be defined in the room it's in.
This is the object enemy attacks consist of mostly, bullets which can interact with the player to damage, heal, and more.
These bullets can behave unique or differently depending on the properties you define in it, and you are given full control on how they move, how they display on the attack and what to do once they hit the player.
Important
Bullets created for menu attacks or normal attacks are placed on an array so the system keeps track of them, it's necessary you do use array_push(_array, _bullet) to put the bullet in their corresponding array, the functions battle_get_bullets_array() and battle_get_menu_bullets_array() do give you the reference to the array you need to use for your bullets. If you do not put the bullets on the array, you will have to handle the bullet manually yourself then and some properties may have no effect on the bullet.
Note
If you modify the properties on the object itself, they will become the default ones the objects come with when created.
Properties:
-
type = BULLET_TYPE.WHITE- Integer (Enum): Defines the type of the bullet, it can only accepts numbers/constants from theBULLET_TYPEenum:BULLET_TYPE.WHITE,BULLET_TYPE.ORANGE,BULLET_TYPE.CYAN,BULLET_TYPE.GREEN, when creating the bullet define this property to change the behavior of your bullet.- White damages on hit.
- Orange damages when not moving.
- Cyan damages when moving.
- Green heals the
damageamount.
-
can_damage = true- Boolean: Defines if the bullet can hit the player to damage it (or heal it), if false, the bullet won't do its effect. -
damage = 1- Integer: Amount of damage (or heal) the bullet will do on hitting the player, usually you define this amount when creating the bullet on the enemy attack script, check out the Enemy Attacks and Bullets section of the User Manual.- If the number is 0 the bullet will do nothing but still count as hitting the player, if negative the effect will be reversed, so damage becomes healing and healing becomes damage, but sounds do not change, green bullet will still play the heal sound effect and damaging bullets will play the damaging sound.
-
box_depth = inst_battle_box.depth- Integer: Defines the logical depth of the bullet, if the player shares the same number in itsbox_depthproperty, this bullet can collide with the player then, otherwise it doesn't collide with it (therefor can't cause damage or healing), by defaul it uses the original box's depth.-
box_depthis meant to be used so when the player is on a box of the same depth as this bullet's box_depth, so it can damage them, can be used on pair withmask_to_boxandbox_for_maskproperties. - This doesn't affect rendering, so you can use
depthindependently frombox_depth.
-
-
mask_to_box = false- Boolean: Defines if the bullet should only be shown inside the box area only, masking it only to appear inside the box. -
box_for_mask = inst_battle_box-obj_boxinstance: Defines whichobj_boxobject should the bullet use to mask on, so it only appears inside one box at a time. -
karma = 1- Integer: Amount of karma the bullet will give when hitting the player regardless of if the bullet causes or not damage to the player.- if the karma is higher than 1, it will be reduced every hit on the player till it reaches 1, more details on how this mechanic works can be found on this wiki page of Undertale.
- This property must be defined even if the player is not in Karmic Retribution status effect, the bullet will not apply karma if the status effect is not in Karmic Retribution state, can be changed using
battle_set_player_status_effect(). - Even healing bullets (green type) can apply karma! So make sure to set it to 0 for healing bullets.
-
persistent = false- Boolean: Defines if the bullet persists after the attack is done, still being active and capable of damaging the player on the menu, these bullets don't form part of menu attacks in the system, these are just lose bullets.- Make sure you take into account this property and the current state the battle is on (using
battle_get_state()) in its methods to make the bullet behave as you want when attacks are finished and the bullet is still existing.
- Make sure you take into account this property and the current state the battle is on (using
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the bullet itself or other objects, it's undefined by default so it does nothing. -
before_draw = undefined: Method that executes every step of the game before the draw event, used to draw stuff on screen at the depth level of the bullet, it's undefined by default so it does nothing. -
draw = draw_self: Method that executes every step of the game on the draw event, used to draw stuff on screen at the depth level of the bullet, it's undefined by default so it does nothing. -
after_draw = undefined: Method that executes every step of the game after the draw event, used to draw stuff on screen at the depth level of the bullet, it's undefined by default so it does nothing. -
destroy = undefined: Method that executes whenever the bullet is destroyed, either by the call ofinstance_destroy()by you or the engine's system, it's undefined by default so it does nothing. -
clean_up = undefined: Method that executes whenever the bullet is destroyed, either by the call ofinstance_destroy()by you or the engine's system, similar to destroy but this one is meant to be called for cleaning up memory and resources, it's undefined by default so it does nothing. -
before_hit = undefined: Method that executes before the bullet damages the player, it will do nothing if thecan_damageproperty is set to false, it's undefined by default so it does nothing. -
after_hit = undefined: Method that executes after the bullet damages the player, it will do nothing if thecan_damageproperty is set to false, it's undefined by default so it does nothing. -
when_colliding = undefined: Method that executes whenever the bullet collides with the player, doesn't matter if it damages or not the player, just collide with it, it's undefined by default so it does nothing.
Platforms are obstacles that can appear on attacks to make platforming challenges when the player has gravity (blue soul) and even make some navigation hazards when on red soul, these platforms can interact with the player in various ways.
Note
If you modify the properties on the object itself, they will become the default ones the objects come with when created.
Properties:
-
type = PLATFORM_TYPE.NORMAL- Integer (Enum): Defines the platform type, it can only accept numbers/constants from thePLATFORM_TYPEenum:PLATFORM_TYPE.NORMAL,PLATFORM_TYPE.CONVEYOR,PLATFORM_TYPE.TRAMPOLINE,PLATFORM_TYPE.STICKY, when creating the platform define this property to change the behavior of it.-
PLATFORM_TYPE.NORMAL: It's the default green platform you can stand on as blue soul and stops you from going through in the direction its facing with the red soul. -
PLATFORM_TYPE.CONVEYOR: Same as the normal type but it has aconveyor_speedthat slides you across its length every frame if you're touching the side it's facing. -
PLATFORM_TYPE.TRAMPOLINE: As soon as you touch the side it's facing, this platform will launch you with thetrampoline_pushing_strengthvalue towards the direction it's facing. -
PLATFORM_TYPE.STICKY: Same as the normal type, except this one will keep in its surface only allowing you to move along its length until you "fall off" from the sides of this platform.
-
-
length = 100- Float: Defines the length of the platform, when creating the platform you can define this property and change it to change its length. -
conveyor_speed = 1- Float: Defines the speed at which the conveyor belt will be moving you when you touch its surface, only applies if the platform type isPLATFORM_TYPE.CONVEYOR. -
trampoline_pushing_strength = 6080/1444- Float: Defines the strength in pixels at which you will be launched when touching the surface of the platform, only applies if the type isPLATFORM_TYPE.TRAMPOLINE(the number assigned by default comes from calculations with the blue soul physics2*max_jump_height/power(max_air_time, 2)*max_air_time, wheremax_jump_height = 80andmax_air_time = 38). -
fragile = {- Struct: Defines data about the platform's fragility, you can set all these properties when creating the platform:-
duration_time: 0- Integer: Time in frames per second (remember by default the game runs on 60 FPS) the platform takes to fall off/disappear when it is touched. -
respawn_time: 90- Integer: Time in frames per second (remember by default the game runs on 60 FPS) the platform takes to respawn and be interactible again, this value is taken in account only ifrespawnis true. -
respawn: true- Boolean: Defines if the platform can respawn again after it has disappeared, if false, the platform will only be a 1 time use.
-
}
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the bullet itself or other objects, it's undefined by default so it does nothing. -
destroy = undefined: Method that executes whenever the platform is destroyed, either by the call ofinstance_destroy()by you or the engine's system, it's undefined by default so it does nothing. -
is_collidable- DO NOT MODIFY: Method that you can call to check if the platform can be collided with, returns true or false.
The battle box is the place where the player can navigate and dodge attacks, multiple areas of dodging can be created and placed close so the battle boxes merge with each other or carve out holes, making dynamic areas while the player is dodging bullets, you can even place the player outside them and they can be obstacles that push you around.
All battle boxes can have any shape by defining a list of points that represents the box's form using the function battle_set_box_polygon_points.
Warning
The boxes polygonal forms should not have crossing edges, the system was not made to handle such cases.
Important
In battles there's always one battle box that's called inst_battle_box, this one must always remain on battles and never deleted, you can modify properties of it like any other box, but this one everytime an attack ends doesn't get removed but its depth, rotation (not directly image_angle property) and type properties gets reset to 200, 0 and BATTLE_BOX_TYPE.NORMAL respectively, its polygon points get reset as well to shape a normal box again and its position (not directly x or y properties) gets reset as well to where it belongs.
Note
If you modify the properties on the object itself, they will become the default ones for the objects when created.
Properties:
-
type = BATTLE_BOX_TYPE.NORMAL- Integer (Enum): Defines the type of battle box, it can be one of three values:BATTLE_BOX_TYPE.NORMAL,BATTLE_BOX_TYPE.HOLE,BATTLE_BOX_TYPE.MERGE.-
BATTLE_BOX_TYPE.NORMALis the default type that has no special properties, just a container for the player to be inside or outside so it collides with the walls. -
BATTLE_BOX_TYPE.MERGEis the type that can combine areas with any other shape of the same type orBATTLE_BOX_TYPE.NORMALtype ones too, their areas unite when intersecting. -
BATTLE_BOX_TYPE.HOLEis the type that carves holes onto the other two type of boxes, they do nothing if they are not overlapping parts of the other two types of boxes and therefor have no collision, they are meant to be used in combination with other types of boxes.
-
-
resize_speed = 20- Real: Defines the amount of pixels the box will change size every frame to reach a target size set bybattle_resize_boxfunction. -
movement_speed = 5- Real: Defines the amount of pixels the box will move every frame to reach a target position set bybattle_move_boxorbattle_move_box_tofunctions. -
rotation_speed = 5- Real: Defines the amount of degrees the box will rotate every frame to reach a target rotation set bybattle_rotation_box_toorbattle_rotate_boxfunctions. -
box_fill_color = c_black- Integer (Color): Defines the color of the inside part of the box, by default it's black, although in Undertale it's transparent. -
box_fill_alpha = 1- Real: Defines the transparency of the inside part of the box, by default it's fully visible, although in Undertale it's transparent so it's 0 actually. -
depth = 200- Integer: This is a built-in variable of Game Maker Studio 2 objects, that determinates the depth of its drawing, by default it's 200, but the reason it's mentioned here is to mention that this depth determinates if it interacts with other boxes, only boxes that are on the same depth will interact with it and if their types allow it, you can change it manually on battles but it's recommended you use thebattle_set_box_depthfunction.
Methods that manipulate the box can be found in the Battle Functions page of the User Manual, have in mind that you can create multiple boxes so most of the functions will require you to pass the box reference (by default they pass the inst_battle_box reference, the main box of the battle room).
Buttons are the objects that the player navigates when it's their turn and select diverse options in battle, these buttons can be selected as well while the player is dodging and when interacting with them it can trigger a function to do diverse stuff (only while the player is dodging an attack), buttons can be moved around in battle, changed sized, etc.
Note
Buttons deselect on specific states, they don't always deselect when the player is no longer colliding with them, the states it deselects on are: BATTLE_STATE.PLAYER_BUTTONS, BATTLE_STATE.PLAYER_DIALOG_RESULT, BATTLE_STATE.ENEMY_DIALOG, BATTLE_STATE.ENEMY_ATTACK and BATTLE_STATE.TURN_END.
Properties:
-
button_type = BUTTON.FIGHT- Integer (Enum): Defines the type of button it is, it's used for displaying the subimage sprite it will show, you can give it a number corresponding to the different type of button it is, it's recommended you use a Enum for this which already is created for you inscr_game_constantsscript.- If you want to add your own custom buttons you need to add them to the
spr_player_buttonssprite resource of the project in the order you define them as constants, since their number defines the position of the subimage, so 1 corresponding to both the first two subimages, and so on.
- If you want to add your own custom buttons you need to add them to the
-
interaction_key = "confirm"- String: Defines the key you can use to trigger theinteractionmethod property only when dodging attacks and the player is colliding with the button, it can only be "confirm", "cancel", "menu" or a single character between "" so anord()function can parse it for use. -
can_interact = true- Boolean: Defines if the player can interact with the button while dodging attacks, executing theinteractionmethod using theinteraction_keydefined. -
can_select = true- Boolean: Defines if the animation of the button being selected plays whenever the player is colliding with the button, this applies at any moment in battles, so while it's the player's turn you can make a button not select or change sprite, useful if you want to make specific animation perhaps. -
heart_button_position_x = -39- Real: Defines the X position relative to the button's X position the player is gonna be positionated when the player is selecting the button while its their turn. -
heart_button_position_y = 0- Real: Defines the Y position relative to the button's Y position the player is gonna be positionated when the player is selecting the button while its their turn.
Methods:
-
interaction = undefined: Method that executes whenever the player presses the interaction key defined touching the button object whle it's dodging an attack, it's undefined by default so it does nothing. -
step = undefined: Method that executes every step of the game, used to do some game logic on the button itself or other objects, it's undefined by default so it does nothing.
This is the object that the player controls, the soul representation that dodges attacks and manages varios soul modes to make battles happen, this object should never be destroyed from battle rooms as the system requires it.
Properties:
-
movement_speed = 2- Real: Defines the speed of the player's soul in battle, usually is 2 pixels per frame (the game by default runs on 60 FPS). -
trail = false- Boolean: Flag that defines if draw or not a trail for the player's soul, you can also useplayer_set_trail()function too to set and modify the flag on other places of the engine. -
box_depth = inst_battle_box.depth- Integer: Defines thedepthof the boxes and thebox_depthof the bullets that the player can collide and interact with, if thedepthorbox_deptharen't the same number as the player'sbox_depth, then it ignores collision.- This doesn't affect rendering, so you can use
depthindependently frombox_depth.
- This doesn't affect rendering, so you can use
-
gravity_data = {- Struct: Defines data about the player's gravity soul mode, set these up on theobj_player_battleitself to modify them as there are no functions to change this behavior, you can change directly the properties in code accessing the correct references:-
allowed_angle_range_to: {- Struct: This struct defines the angle ranges collisions are considered floor, ceiling or surfaces from which you can jump of, they work on any direction the gravity soul's gravity is on.-
grip: 20- Real: Defines the range of angle from 90 degrees (up direction when gravity is down, the default) where the collisions are considered floors, meaning you won't slide down from them like walls, for example 20 makes it so the range of 70-110 degrees surfaces don't make the player slide down them, if set to 0 even a slight slope of 1 degree can cause the player to slide down very slowly. -
jump: 40- Real: Defines the range of angle from 90 degrees (up direction when gravity is down, the default) where the collisions are valid to jump from, so even if you're sliding down them you will be able to jump from them. -
bonk: 45- Real: Defines the range of angle from 270 degrees (down direction when gravity is down, the default) where the collisions are considered ceilings and make you lose all your momentum (even reflecting it), otherwise they are considered walls and player slides from them.
-
}-
movement: {- Struct: This struct contains data about movement of the orange soul mode which is included on the gravity soul.-
direction_change_time: 4- Integer: This indicates how many frames it takes for the orange soul to fully change direction.
-
}-
jump: {- Struct: This struct contains data about how high can the gravity soul jump and how long the jump lasts.-
duration: 38- Integer: Defines how many frames does the jump last. -
max_height: 80- Real: Defines the maximum height in pixels the soul can jump from where it started the jump.
-
}
-
}
Methods that manipulate the player's soul in battles can be found in the Battle Functions page of the User Manual.
This object is an auxiliar that is even used in the engine to perform drawing operations at specific depth levels that no object can cover without interfering with other object's depth drawing, its main purpose is to draw stuff on screen, you manage these objects manually yourself.
Note
This object has no properties, you can define any that you need for your rendering purposes, technically this object can also run logic by its own because of the step method it can run, while it is not recommended it is a thing you can do.
Methods:
-
step = undefined: Method that executes every step of the game, used to do some game logic on the renderer itself or other objects, it's undefined by default so it does nothing. -
draw = undefined: Method that executes every step of the game on the draw event, used to draw stuff on screen at the depth level of the renderer, it's undefined by default so it does nothing. -
clean_up = undefined: Method that executes whenever the renderer is destroyed, either by the call ofinstance_destroy()by you or the engine's system, this one is meant to be called for cleaning up memory and resources, it's undefined by default so it does nothing.