Make a game like Lumines with Flash

I have to admit it… I got completely addicted to this game… so I decided to make my own Flash version.

If you don’t know what is Lumines, it’s a casual game you can download from Steam.

Lumines

The game is simple: control squares made by 2×2 bricks of different colors falling from the top like in Tetris… as you create 2×2 squares in same color, the vertical time line wipes them away from left to right.

In this first part, I’ll create the game field, and the square made by 2×2 bricks, that can be moved and rotated with arrow keys.

There is nothing really hard… but I couldn’t make the entire 2×2 square as a single movieclip because later in the game the square can “break” if it falls over existring bricks.

So every 2×2 square is formed by four movieclips.

There is only one object in the library at the moment… a movieclip linked as brick that contains the graphics for the empty grid at frame 1 and the graphics for colored bricks at frames 2-5

Then, I wanted the bricks to move and rotate when the player taps (press and released) arrow keys, not just when he presses them.

The code is completely commented:

and here it is the result: move and rotate the square with arrow keys.

here it is the source code for you to experiment.