[Asset pack] Tile Flipper development

Brief

Currently, Me and fellow unity user Daniel Quick are working on an asset pack for the asset store. the asset pack it self will be a completed game in which you flip the tiles and the aim is to get all the tiles facing the correct way up. The pack will be priced from $5-$15 depending on the contents of the final piece, and also may extend higher if we manage to create it iOS ready. This project is just as much educational based for me and Daniel as it is commercial and we hope that it provides of use to the community. And we hope you follow us through the creation stages and support us as well as give critism and feedback,

We are aiming to include:

-Approx 100 levels of varied difficulty
-Two polished, clean, visual great themes
-Full and thorough documentation
-Android ready
-Full kitted GUI

How the game is played
The game is played by flipping tiles which in turn flip all adjacent tiles. In ‘image’ form:

OOO
OOO
OOO

Flipping the center tile will do this:

OXO
XXX
OXO

The game will get progressively harder forcing you to make more flips and thinking more tactically to complete the level in X amount of turns. Another feature we will be implementing is expanded board sizing.

Preparation

Currently, We have prepped the game mechanics and now working on the art style and levels.

First of all, I took the liberty of creating a basic console program to show the core mechanic of the game. You can find this file here and test:
http://dl.dropbox.com/u/21992753/Tile_Flipper.exe.exe

Alternativly if you are uncomfortable downloading an EXE file you can simply copy this code and re-produce the program yourself through VB:

Module Module1

    Sub Main()
        Randomize()
        Dim gamecomplete As String
        Dim flip(9) As Integer
        Dim selected As Integer
        Dim turncount As Integer
        turncount = 0
        gamecomplete = "no"
        Call setnum(flip)
        Do Until gamecomplete = "yes"
            If gamecomplete = "no" Then
                Console.Clear()
                Call game(flip, selected, turncount)
                turncount = turncount + 1
            End If


        Loop

 


    End Sub
    Sub setnum(ByRef flip() As Integer)
        flip(1) = (Rnd() * 1)
        flip(2) = (Rnd() * 1)
        flip(3) = (Rnd() * 1)
        flip(4) = (Rnd() * 1)
        flip(5) = (Rnd() * 1)
        flip(6) = (Rnd() * 1)
        flip(7) = (Rnd() * 1)
        flip(8) = (Rnd() * 1)
        flip(9) = (Rnd() * 1)

    End Sub
    Sub setnew(ByRef flip() As Integer, selected As Integer)
        'NUM PAD 1'
        If selected = 1 Then
            If flip(7) = 1 Then
                flip(7) = 0
            ElseIf flip(7) = 0 Then
                flip(7) = 1
            End If

        End If

        If selected = 1 Then
            If flip(4) = 1 Then
                flip(4) = 0
            ElseIf flip(4) = 0 Then
                flip(4) = 1
            End If

        End If

        If selected = 1 Then
            If flip(8) = 1 Then
                flip(8) = 0
            ElseIf flip(8) = 0 Then
                flip(8) = 1
            End If

        End If

        'NUM PAD 2'
        If selected = 2 Then
            If flip(8) = 1 Then
                flip(8) = 0
            ElseIf flip(8) = 0 Then
                flip(8) = 1
            End If
        End If
        If selected = 2 Then
            If flip(9) = 1 Then
                flip(9) = 0
            ElseIf flip(9) = 0 Then
                flip(9) = 1
            End If
        End If
        If selected = 2 Then
            If flip(7) = 1 Then
                flip(7) = 0
            ElseIf flip(7) = 0 Then
                flip(7) = 1
            End If
        End If
        If selected = 2 Then
            If flip(5) = 1 Then
                flip(5) = 0
            ElseIf flip(5) = 0 Then
                flip(5) = 1
            End If
        End If
       

        'NUM PAD 3'

        If selected = 3 Then
            If flip(8) = 1 Then
                flip(8) = 0
            ElseIf flip(8) = 0 Then
                flip(8) = 1
            End If
        End If
        If selected = 3 Then
            If flip(9) = 1 Then
                flip(9) = 0
            ElseIf flip(9) = 0 Then
                flip(9) = 1
            End If
        End If
        If selected = 3 Then
            If flip(6) = 1 Then
                flip(6) = 0
            ElseIf flip(6) = 0 Then
                flip(6) = 1
            End If
        End If

        'NUM PAD 4'

        If selected = 4 Then
            If flip(4) = 1 Then
                flip(4) = 0
            ElseIf flip(4) = 0 Then
                flip(4) = 1
            End If
        End If
        If selected = 4 Then
            If flip(1) = 1 Then
                flip(1) = 0
            ElseIf flip(1) = 0 Then
                flip(1) = 1
            End If
        End If
        If selected = 4 Then
            If flip(7) = 1 Then
                flip(7) = 0
            ElseIf flip(7) = 0 Then
                flip(7) = 1
            End If
        End If
        If selected = 4 Then
            If flip(5) = 1 Then
                flip(5) = 0
            ElseIf flip(5) = 0 Then
                flip(5) = 1
            End If
        End If

        'NUM PAD 5'

        If selected = 5 Then
            If flip(8) = 1 Then
                flip(8) = 0
            ElseIf flip(8) = 0 Then
                flip(8) = 1
            End If
        End If
        If selected = 5 Then
            If flip(6) = 1 Then
                flip(6) = 0
            ElseIf flip(6) = 0 Then
                flip(6) = 1
            End If
        End If
        If selected = 5 Then
            If flip(4) = 1 Then
                flip(4) = 0
            ElseIf flip(4) = 0 Then
                flip(4) = 1
            End If
        End If
        If selected = 5 Then
            If flip(5) = 1 Then
                flip(5) = 0
            ElseIf flip(5) = 0 Then
                flip(5) = 1
            End If
        End If
        If selected = 5 Then
            If flip(2) = 1 Then
                flip(2) = 0
            ElseIf flip(2) = 0 Then
                flip(2) = 1
            End If
        End If


        'NUM PAD 6'

        If selected = 6 Then
            If flip(6) = 1 Then
                flip(6) = 0
            ElseIf flip(6) = 0 Then
                flip(6) = 1
            End If
        End If
        If selected = 6 Then
            If flip(9) = 1 Then
                flip(9) = 0
            ElseIf flip(9) = 0 Then
                flip(9) = 1
            End If
        End If
        If selected = 6 Then
            If flip(5) = 1 Then
                flip(5) = 0
            ElseIf flip(5) = 0 Then
                flip(5) = 1
            End If
        End If
        If selected = 6 Then
            If flip(3) = 1 Then
                flip(3) = 0
            ElseIf flip(3) = 0 Then
                flip(3) = 1
            End If
        End If

        'NUM PAD 7'

        If selected = 7 Then
            If flip(4) = 1 Then
                flip(4) = 0
            ElseIf flip(4) = 0 Then
                flip(4) = 1
            End If
        End If
        If selected = 7 Then
            If flip(1) = 1 Then
                flip(1) = 0
            ElseIf flip(1) = 0 Then
                flip(1) = 1
            End If
        End If
        If selected = 7 Then
            If flip(2) = 1 Then
                flip(2) = 0
            ElseIf flip(2) = 0 Then
                flip(2) = 1
            End If
        End If

        'NUM PAD 8'

        If selected = 8 Then
            If flip(5) = 1 Then
                flip(5) = 0
            ElseIf flip(5) = 0 Then
                flip(5) = 1
            End If
        End If
        If selected = 8 Then
            If flip(3) = 1 Then
                flip(3) = 0
            ElseIf flip(3) = 0 Then
                flip(3) = 1
            End If
        End If
        If selected = 8 Then
            If flip(1) = 1 Then
                flip(1) = 0
            ElseIf flip(1) = 0 Then
                flip(1) = 1
            End If
        End If
        If selected = 8 Then
            If flip(2) = 1 Then
                flip(2) = 0
            ElseIf flip(2) = 0 Then
                flip(2) = 1
            End If
        End If

        'NUM PAD 9'

        If selected = 9 Then
            If flip(2) = 1 Then
                flip(2) = 0
            ElseIf flip(2) = 0 Then
                flip(2) = 1
            End If
        End If
        If selected = 9 Then
            If flip(3) = 1 Then
                flip(3) = 0
            ElseIf flip(3) = 0 Then
                flip(3) = 1
            End If
        End If
        If selected = 9 Then
            If flip(6) = 1 Then
                flip(6) = 0
            ElseIf flip(6) = 0 Then
                flip(6) = 1
            End If
        End If


    End Sub
    Sub game(ByRef flip() As Integer, selected As Integer, turncount As Integer)
        Console.WriteLine("                                To play use the numpad")
        Console.WriteLine("           Make all the sides = 0, Flipping one tile will flip all adjacent")
        Console.WriteLine()
        Console.WriteLine("                                      Turns: "  turncount)
        Console.WriteLine()
        Console.WriteLine("                                     "  flip(1)  "   "  (flip(2)  "   "  flip(3)))
        Console.WriteLine()
        Console.WriteLine("                                     "  flip(4)  "   "  (flip(5)  "   "  flip(6)))
        Console.WriteLine()
        Console.WriteLine("                                     "  flip(7)  "   "  (flip(8)  "   "  flip(9)))
        selected = Console.ReadLine
            Call setnew(flip, selected)
       
    End Sub
End Module

I Hope my code isn’t to awful as an artist…

Development

From here, we have started to build the pack. so far we have a base build which contains the core mechanic of the game just like in the console version, Dan has put this together and now we are focusing on the design of the blocks and also the level difficulty.

First build:

-Basic mechanic
http://dl.dropbox.com/u/17638504/Webplayers/TileGame/WebPlayer/WebPlayer/WebPlayer.html

Please feel free to give us you’re feedback on what levels (If any) you found difficult and which you think are in the wrong order.

Currently doing:

-Working on the level design
-Working on test levels

To do graphically:
-Create UI
-Finalize level design
-Texture
-Create other menus
-Animate tiles

To do programming:
-Create necessary responses such as amount of turns taken
-Timer
-Level difficulty
-game mode
-other necessary programming such as camera movement

Concept of tile design:

Similar to that of a circuit board.

I will be updating this thread over the next few days until the completion of this project on behalf of me and Dan, posting regular web builds and screenshots of development. I hope you to recieve some insightful feedback, and I thank you for reading.

Kind regards

-Charlie

All programming by Dan
All Art by me

Good luck mate, although I think 100 levels is probably a little crazy…

There are only 512 (2^9) possible board combinations, and for all intents and purposes problems that are a rotation or a reflection of each other are the same puzzle, i.e. it’s pointless to have two different puzzles like

001 100
001 100
001 100

With that in mind 100 levels is getting pretty close to every meaningful combination (i.e. you might as well just auto generate the puzzles).

Why not include 20 or so graduated levels of difficulty and then a random puzzle generator? (I’m not sure if the 3x3 board is always solvable, but it should be pretty easy to write a program to determine if it is… wikipedia describes a general solver for the game Lights Out (game) - Wikipedia).

Another extension would be to make the game board a flexible size, or even a flexible shape.

  • John A

EDIT: You probably don’t even need to create the 20 levels… you can probably get a pretty good estimate of difficulty just generating puzzles using a fixed number of moves from the final position. i…e. Easy levels are 2-3 moves, Medium are 4, and Hard 5+.

PS: If you use use an integer as flags the you can replace all your switches with something like this:

	public int state = 0;

	private int [] masks = {11,23,38,89,186,308,200,464,416};

	public void ApplyMove(int pos) {
		state = state ^ masks[pos];
	}

	public bool IsPositionLit(int pos){
		return ((1 << pos)  state) == (1 << pos);
	}

Thanks for the feedback John,

Initially we were hoping to produce the 100 marker through the varies level type schemes. I,e, Larger boards, more tile faces ect ect. Although it may have been a pretty large judgement.

To me, that chunk of code goes straight over my head :smile: but thanks for the advice, ill make sure Dan see’s it.

A cool level idea would be an unfolded rubick’s cube.
With a slight adjustments to the mechanics ( rubick’s cube has row and column movement, not initial squares ) it would be awesome.
I like the idea by the way - simple, portable and with great potential to become an addicting little game.

Thanks for the response :slight_smile: although im not sure what you mean by the rubix idea.

Basically this :
You have the standard flipper mechanic - when you click a square the adjacent squares flip too.
And you have the thing I referenced a cube for - when you click a corner square, its neighbors flip, and the corresponding neighbors as if the whole thing was a cube ( Color markings on the image ).

Adding even more complex rotation ( different colors ), may even mimic some of the rubick’s cubes mechanics and result complex and interesting puzzles.

Ahh thats a really nice idea, may be hard to implement on touch devices for control use but ill point it to dan, Thanks!

New build

http://dl.dropbox.com/u/17638504/Webplayers/TileGame/Build2/WebPlayer/WebPlayer.html

Graphics are on hold for a few days until I get a new mouse.

-Bump

Finally back to work on this.

Split it up and were making it so we can increase and change the boardsize/shape.

Texture time.

Dude, are you aware that the recent version of Blender is 2.62?

Yes I am, are you aware my dell dimension 3100 can’t run it :smile:

Lol, no I wasn’t.
That is some bad luck.

Indeed, im saving for a new desktop but things keep popping up unfortunately, luckily ive had no projects yet which have required me to use anything more than this for modelling.