Dequeues the value from the head of the queue.


GML Code Example


Argument Description
id The id of the queue to dequeue from.

Returns: Real or String


This function will dequeue the head value off of the ds_queue, removing it from the queue and returning the value to be stored in a variable.


GML Code Example

if !ds_queue_empty(move_queue)
    var xx, yy;
    xx = ds_queue_dequeue(move_queue);
    yy = ds_queue_dequeue(move_queue);
    move_towards_point(xx, yy, 4);

The above code checks the ds_queue indexed in the variable "move_queue" to see if it is empty, and if it is not, it then dequeues the two values from the head of the queue and use them to set a direction for movement.

Back: Queues

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here