Skip to content

Object Stack

An ordered list of objects and a shuffle action.

Authors and contributors to this community extension: D8H.


It provides:

  • Actions to modify a stack of objects
  • Conditions to access the objects of a stack
  • A shuffle action

It can be helpful for:

  • Card games
  • Fair randomness (for instance, to create a stack of predetermined bonus and randomize the order they appear)

3 examples use it:

Tip

Learn how to install new extensions by following a step-by-step guide.

Conditions

Contain
Check if the stack contains the object.

Contain at
Check if the stack contains the object at a height.

Contain between a range
Check if the stack contains the object between a range. The lower and upper bounds are included.

Stack top
Check if an object is on the stack top.

Object Stack

Hold an ordered list of objects.

Behavior actions

Add on top
Add the object on the top of the stack.

Clear
Remove any object from the stack.

Insert into the stack
Insert the object into the stack.

Move all into the stack
Move all the object from a stack into another.

Move all on top of the stack
Move all the object from a stack into another one at the top.

Move into the stack
Move the objects from a stack into another.

Remove from the stack
Remove the object from the stack.

Shuffle
Shuffle the stack.

Behavior conditions

Stack height
Compare the number of objects in the stack.

Is empty
Check if the stack is empty.

Behavior expressions

Expression Description
Object.ObjectStack::Height() Return the number of objects in the stack.
Object.ObjectStack::HeightOf() The height of an element in the stack.

This page is an auto-generated reference page about the Object Stack extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.