FIFO in a 2d array

0 favourites
  • 5 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • Hi!

    I've looked at several threads, manual entries and tutorials but I still can't find the solution to my problem.

    I want to do a grid where every column has its own queue (very similar to a 4 in a row game but inverted [like if you could insert coins from the bottom]).

    I've tried the push and pop functions and they work great with 1D columns but, when it comes to 2D, I don't know how to indicate wich column must be pushed and poped.

    Any ideas? I supose it should be an easy task but I don't know much about programming so I can't really figure it out by myself.

    Sorry for opening a new thread about arrays but ,believe me, I have checked the entire page searching for an answer but coudn't find anything related.

    bye and thanks!

  • 've tried the push and pop functions and they work great with 1D columns but, when it comes to 2D, I don't know how to indicate wich column must be pushed and poped.

    The push or pop will affect all the columns. With the array all the columns are the same height, and all the rows are the same width.

    The solution is to have multiple instances of 1d arrays.

  • I thought on having multiples arrays but I suposed there was a better option.

    I gave the push and pop examples but if you know an alternative way to acomplish this queue effect without'em, i'll apreciate it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is an example of my suggestion:

    http://dl.dropbox.com/u/5426011/examples13/array_instances.capx

    An alternate would be to not use an array at all, just use sprites and collisions to do it visually.

  • Thanks! That may work or, at least, simplify things.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)