Skip to content

kohnech/pastry-crunch

Repository files navigation

Pastry crunch

This is a "midars miner" like game and it's about finding at least 3 matches either horizontally or vertically of the same pastry.

Everything is configurable from the assets.json file. Here you can choose any of the important game parameters and even change skins and the look and feeling of the game as it should be.

Any questions? Please ask me or post a PR.

Techniques and 3rd-party libraries

3rd-party libraries

This games relys soly on the SDL2 set of libraries:

  • SDL2 (Basic game engine)
  • SDL2_image (displays jpg/png etc...)
  • SDL2_ttf (display fonts & text)
  • SDL2_mixer (play sounds like wav)
  • Hlohmann Json: https://github.com/nlohmann/json

If you don't have these installed, don't worry, they are included in the Runtime environment as a they should be (best practise) so you don't need to search for any obscure libraries on the internet. In order to setup the correct runtime environment under linux, the simplest way to run the game is

make run

References

Building & setup

Linux

make help

will show you a list of all the make targets. To start building it type:

make all

and to run it:

make run

Windows

Currently only x86 is supported and MS Visual Studio 2015. Open the solution file msvc/pastry_crunch/pastry_crunch.sln in Visual Studio to start debug and run the application. Dependencies and assets are already setup so just hit the run button.

SW Architecture

alt text

Game logic

alt text

Releases

V1.1

  • Added App states
  • Start once, possible to restart
  • Fixed numerous bugs (memory leak etc..)
  • Added separate Thread to Grid for game logic
  • Removed unecessary singletons
  • Resharped code

V1.0

  • Basic features 8 x 8 grid
  • Play once
  • Sound interaction
  • Swap interaction
  • Single Thread: Main (besides SDL threads)