- Fusion is a circular variant of tetris.
- The code is written in
C++
. - All the source code is in
src/
. - Any generated outputs are stored in
data/
. - Simplecpp is used for rendering.
include
&lib
contains headers and implementation of simplecpp.
- The documentation for the code is itself.
- Make sure x11 and x11-dev are installed.
- Open terminal in the root directory.
- Make a build directory using
mkdir build && cd build
. - Create a makefile using
cmake ..
- Compile code using
make
. This creates an executable namedfusion
. - Use
./fusion
to start playing.
- Make a build directory using
- The game board is circular.
- An element (from the periodic table) pops up in the center randomly.
- It can be placed anywhere on the circular board with a mouse click. Once placed, the ones on the board space themselves out equally.
- As one element is placed, a new element pops up again in the center.
- Sometimes a special element
+
pops up.- Once placed in circle, It has the power to fuse elements.
- But for fusion to occur elements on either side of
+
should be mirror images. - For example, if board has
H (1)
+
H (1)
, then bothH
fuse to giveHe (2)
. - More than one pair of elements can be fused at a time.
- For example,
He (2)
H (1)
+
H (1)
He (2)
givesBe (4)
. - Bigger combos generate bigger elements.
- Even
+
's can be fused.+
+
+
givesH (1)
.
- Every time a fusion occurs you get some points based on the size of the combo.
- Notice the number of elements decrease when fusion occurs.
- If the number of elements on the board exceed
12
the game ends. - So the goal is to keep the fusion going and prevent that.
- Place, fuse and repeat to score the highest.
- Scores are recorded in a file. For this a you will be prompted to enter a handle at the beginning.
- Concept taken from Atomas.
The following gifs illustrates the gameplay.
- Single fusion
H (1)
+
H (1)
=>He (2)
.
- Single fusion
He (2)
+
He (2)
=>Li (3)
.
- Multi fusion
He (2)
H (1)
+
H (1)
He (2)
=>Be (4)
.
- Multi fusion
He (2)
He (2)
+
He (2)
He (2)
=>B (5)
.
- Multi fusion
He (2)
H (1)
+
H (1)
He (2)
=>Be (4)
.
- Bad placement.
- Full gameplay.
- Basic game.
- rayAngle()
- 120 element symbols and colors.
- Decouple file i/o from game logic.
- Bubbling effect while fusing.
- Implement good data structure for maintaining game state. Round Table Conference Structure i.e. Circular double linked list.
- Random new atomic number based on max atomic number achieved. Use normal dist with mean = 0.5 max achieved, std = 1.
- Fix high score logic.
- Improve game experience.
- Highest Element achieved.
- Element Symbol.
- Score.
- Randomness.
- + element.
- Colors.
- Place the first element on top instead of right side.
- It's better to provide a restart option after game-over instead of closing the window.
- Show the scoreboard on the terminal along with current score and rank.
- Close canvas properly.
- Fix stoi bug.