Methods
-
add_to_group(object, group)
-
Adds the given object to the front of the group.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject that gets added to the group
groupgroup that the object is getting added to
Code Equivalent:
group.add(newItem); -
add_to_world(object)
-
Adds the object to the top of the World group.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to add to the group
Code Equivalent:
game.world.add(object); -
Blockly.JavaScript['call_function_on_group'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
Blockly.JavaScript['create_object_in_group_with_frame'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
Blockly.JavaScript['group_get_first_alive_dead'](block)
-
Parameters:
Name Type Description blockCode Equivalent:
undefined -
create_group()
-
Creates a container to hold multiple sprites. Assign to a variable for future use.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.add.group() -
create_object_in_group(x, y, tag)
-
Creates an object at a position with the given tag, and adds it to the front of the group.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description xNumber the x coordinate to display the new object at, relative to the position of the group
yNumber the y coordinate to display the new object at, relative to the position of the group
tagString the tag of the image to assign to the object
Code Equivalent:
group.create(x, y, tag) -
create_object_in_group_with_frame(x, y, frame, tag, group)
-
Creates a new object from the tag and adds it to the front of the group. Assign to a variable for future use.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description xNumber the x position for the object to be displayed at
yNumber the y position for the object to be displayed at
frameNumber the frame of the sprite sheet to display at the start
tagString the sprite to display on the object
groupthe group to add the object to
Code Equivalent:
group.create(xPos, yPos, tag, frame) -
destroy_group(group, handleChildren)
-
Removes all objects and deletes the group, with the option to delete the objects as well.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to destroy
handleChildrenoption to delete all containing objects
Code Equivalent:
group.destroy(handleChildren); -
group_contains(group, object)
-
Figures out if the group contains the object, and returns true or false.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to check
objectobject to check
Code Equivalent:
group.contains(child) -
group_count_alive_dead(group, state)
-
Figures out how many objects are alive or fainted in the group, and returns the number.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to check
statedetermines if you are checking alive or fainted.
Code Equivalent:
group.countstate() -
group_get_all(group)
-
Returns all objects in the group, to make changes or get information from them all at the same time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get all objects from
Code Equivalent:
group.getAll() -
group_get_at(group, index)
-
Returns the object at the position of the given index in the group.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get the object from
indexNumber position of the object in the group
Code Equivalent:
group.getAt(index) -
group_get_closest_to(group, object)
-
Returns the object in the group physically closest to the given object, based on their x/y coordinates.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get the object from
objectobject to base the position from
Code Equivalent:
group.getClosestTo(object) -
group_get_first_alive_fainted(group, mode)
-
Returns the first object closest to the front of the group that is alive/fainted.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get the object from
modedetermines if you are checking for an alive or fainted object
Code Equivalent:
group.getFirstmode() -
group_get_random(group)
-
Returns a randomly chosen object from the group.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get the object from
Code Equivalent:
group.getRandom() -
group_get_random_exists(group)
-
Returns a randomly chosen object from the group that has exists set to true.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to get the object from
Code Equivalent:
group.getRandomExists() -
group_remove_all(group, deleteObjects)
-
Remove all members from the group, with the option to delete them as well.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description groupgroup to remove the objects from
deleteObjectsBoolean option to delete the objects after removing them from the group
Code Equivalent:
group.removeAll(deleteObjects); -
remove_from_group(object, group, destroy)
-
Removes the given object from the group, with the option to remove it from the game as well.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject that gets removed from the group
groupgroup that the object is getting removed from
destroyBoolean option to remove the object from the game
Code Equivalent:
group.remove(child, destroy);