FIFO in a 2d array

0 favourites
  • 5 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)