Skip to content

Futoshiki Game + In-built Level Editor recreated using raylib + C++

License

Notifications You must be signed in to change notification settings

vedangjavdekar/Raylib_Futoshiki

Repository files navigation

About

The game is called Futoshiki.

Here's what wikipedia says about it:

Futoshiki (不等式, futōshiki), or More or Less, is a logic puzzle game from Japan. Its name means "inequality". It is also spelled hutosiki (using Kunrei-shiki romanization). Futoshiki was developed by Tamaki Seto in 2001.

The puzzle is played on a square grid. The objective is to place the numbers such that each row and column contains only one of each digit. Some digits may be given at the start. Inequality constraints are initially specified between some of the squares, such that one must be higher or lower than its neighbor. These constraints must be honored in order to complete the puzzle.

The project is built with an amazing game framework called raylib.

The game is complete with an in built level editor. The game engine is written in C++ and has some features I am proud of!

Keybindings

Global Bindings:

Key Action
Enter Commit
Escape Cancel
L Open Level Select Menu

Game Mode:

Key Action
P Switch to Play Mode
Up Arrow or W SELECT UP
Down Arrow or S SELECT DOWN
Left Arrow or A SELECT LEFT
Right Arrow or D SELECT RIGHT
Numpad 1 or 1 Toggle Cell Value to 1
Numpad 2 or 2 Toggle Cell Value to 2
Numpad 3 or 3 Toggle Cell Value to 3
Numpad 4 or 4 Toggle Cell Value to 4
Numpad 5 or 5 Toggle Cell Value to 5
Numpad 6 or 6 Toggle Cell Value to 6
Numpad 7 or 7 Toggle Cell Value to 7
Numpad 8 or 8 Toggle Cell Value to 8
Numpad 9 or 9 Toggle Cell Value to 9
Ctrl + Numbers Toggle Guess Mode cell values

Editor Mode:

Key Action
E Switch to Edit Mode
Up Arrow or W SELECT UP
Down Arrow or S SELECT DOWN
Left Arrow or A SELECT LEFT
Right Arrow or D SELECT RIGHT
Numpad 1 or 1 Toggle Lock Value to 1
Numpad 2 or 2 Toggle Lock Value to 2
Numpad 3 or 3 Toggle Lock Value to 3
Numpad 4 or 4 Toggle Lock Value to 4
Numpad 5 or 5 Toggle Lock Value to 5
Numpad 6 or 6 Toggle Lock Value to 6
Numpad 7 or 7 Toggle Lock Value to 7
Numpad 8 or 8 Toggle Lock Value to 8
Numpad 9 or 9 Toggle Lock Value to 9
Ctrl + Number Set Board Size to Number $\times$ Number
R Reload the original values from the Level File
Ctrl + R Create a blank board with current/default size
F Save as New Level
Ctrl + F Overwrite Current Level File
Escape Switch to Play Mode

Level Select:

Only Navigational controls and Commit and Cancel actions work.

Screenshots

StateOfFutoshiki_Faster.mp4

Screenshot1 Screenshot2

Building

  • This project uses premake5(included with the project) as its build system.
  • Just run the GenerateProjectFiles.bat and it will create a visual studio solution.
  • Then the project can be built from within the visual studio.

Features

The engine is specifically build for Futoshiki Here are some notable features:

  • Event Handling through Event Bus
  • Level Selection UI
  • Animated Scrollbox
  • Notifications capabilities
  • In-built Level Editor
  • Support for Relative Positioning with respect to screen size for UI Elements.
  • Fully Keyboard based navigation as well as playing

The game is feature complete:

  • Level Selection Menu
  • Each level is editable and overwritable
  • Adding new levels is as easy as dropping a *.data file in the required format in the data/ directory
  • Game comes with 15 levels right now.

Ideas to explore further

  • Using the github repo as a central level database, and fetching all the levels at the start of the game.
  • Getting the community created content through pull requests.
  • Making this project cross platform:
    • Scripts for building on Linux and Mac.
    • Removing the WinMain from the code.
  • Find better solutions Level Selection and how it tries to rename every single level if one of the in betweens are missing.