Question

I am planning to develop Loop the loop, also known as Fences, puzzle game on Android. It basically consist of n by m (n X m) matrix of cells. Each cell has edges and corners(dots). The rules are simple. You have to draw lines between the dots to form a single loop without crossings or branches. The numbers withing a cell indicate how many lines surround it. Refer Puzzle_LoopTheLoop for rules and to try out.

To develop visual n X m matrix, I think of using a gridlayout of n X m rows. Each cell will hold a button with default opacity of 0, i.e. it is transparent. When user clicks an edge, its opacity will be toggled to 1, i.e. the button will get highlighted indicating that an edge is selected as shown below.

GridLayout containing Buttons as edges, corners and cells

Apart from handling user clicks(touch) events for enabling/disabling, the event will be dispatched to surrounding cells to increase/decrease its active edge count.

My questions are as below: 1) My choice of gridlayout may not be best choice or it could be inefficient. Could you give your opinion on this? 2) Are there other API/libraries that have better data structure to handle the nXm with edge handling? 3) For edges, would ImageButton be a better choice? 4) Any other input for this game development, rather a visual puzzle development. I say this because it is very unlike normal 2D games where actors occupy any place on the game area. 5) Let me know if this post should have been posted in any other area, like any specific forum/wiki or like similar?

Many thanks in advance for your inputs.

Was it helpful?

Solution

  1. Normally games for android are designed using the Canvas and OpenGL, but since your app doesn't require high graphics processing power, it can be implemented. But my opinion is to use your own matrix framework, you could control and manage more comfortably.

  2. I doubt there would be any API for this. By default android has matrix class but that is used primarily for bitmap processing. Grid serves your purpose here.

  3. Again if you are not making your own framework, then imageButton may serve the purpose. CheckBox with a different image drawable can also be used.

  4. Cannot understand the questions...

  5. No Idea, I am new too...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top