Dimenticare

Basic stack inventory code

May 28th, 2015
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /// Add to stack
  2. ds_stack_push(inv, other);      // "other" being the other object (the item) involved in the collision
  3. other.x=32*ds_stack_size(inv)*32;   // X position on screen, not important otherwise
  4. other.y=32;             // Y position on screen, not important otherwise
  5.  
  6. /// Remove from stack
  7. if (!ds_stack_empty(inv)){
  8.     n=ds_stack_pop(inv);
  9.     with (n)
  10.         instance_destroy();
  11. }
Advertisement
Add Comment
Please, Sign In to add comment