Help forming a queue of actors

moefauxmoefaux Member Posts: 0
edited June 2012 in Working with GS (Mac)
Hi there. I'd like to have actors lined up in a queue (or queued up in a line); when it's their "turn", everyone in the line moves forward one space, and the actor at the front of the line is removed from the queue.

I'm having trouble wrapping my head around how to do this. I can think of an example, like Diner Dash, where customers wait for tables and the line grows (to a maximum), but if anyone could give me some ideas of how to start thinking about it, I'd appreciate it. I keep thinking in terms of old-school programming (arrays) but I'm sure this can be done. Many thanks for your help!

Answers

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited June 2012
    It can be done, in fact i did something similar today...you need tables.

    I made a start on this for an upcoming tetris type game where the user can see whats coming next but its the same principle.



    Notice the actor id drops down 1 when a tile is used so the bottom actor is the one that's live.

    You can do this using one table and one actor.

    I basically made a table with integers and set a game integer counter to +1 when a tile is used.

    If i get time 2morro i will do a video.

    Darren.
Sign In or Register to comment.