ds_stack_push

This function will push (add) a value, which can be of any data type, onto the top of the stack. The function can take any number of additional arguments, permitting you to push multiple values consecutively to the stack in a single call.

 

Syntax:

ds_stack_push(id, val [, val2, ...]);

ArgumentTypeDescription
idDS StackThe id of the data structure to push onto.
valAnyThe value to push onto the stack.
[val2, ...]AnyOptional values to be added to the stack, each one a new argument.

 

Returns:

N/A

 

Example:

move_stack = ds_stack_create();
ds_stack_push(move_stack, x, y, x, y + 200, x + 200, y + 200, x + 200, y);

The above code creates a new DS stack and stores its index in the variable "move_stack". It then pushes a number of values onto the stack for future use.