8-puzzle game

  1. Jarkko Pulli
  2. Lauri Kyttälä
  3. Petteri Pekonen

Idea

8-puzzle is a game where the player tries to get the 8 pieces into certain order on the board where there are 9 slots.

In our game we will measure the time used and moves to get the game solved. Using time and moves game creates high score list for top 3 players.

Game can be plaid using touch screen or using device movement controlling for peace movements.

Game difficulty can be selected between easy to hard. Difficulty based on mixing pieces. Easy game can be solved about moving 3 pieces and hard can be solved moving pieces 50 times.

Game can get image on internet and create puzzle based on that image. Game is solved when player sees similar image than the original.

An image about the idea of the game lookout and the basic menu.

Two player’s game. Connect two phones and two players. Idea is to play against human player and the one who solve the puzzle first is the winner. Main idea is that on the phone screen can be seen two similar game boards. Player can move pieces only on his own board. Player can see opponents board and piece movements and both players have the same starting puzzle.

An image shows idea of the two players game

Features

1 = most critical feature, 3 = least critical

Feature Priority Implemented
Board 1 Yes
Piece movement 1 Yes
Game end 1 Yes
Exit 1 Yes
New game 2 Yes
Time/Move 2 Yes/No
Instructions 3 Yes
High scores 3 Yes
Device movements 3 Yes
Changeable image in puzzle 3 Yes
Picture from the Web according the GPS location 3 No

Table 1 contains features and priorities

Implementation Plan and Goals

Implementation based on features, priorities and dividing tasks. Idea is to implement first most critical features like board, piece movement, game end and exit. After that we have puzzle that can be plaid and exit the game. In the second phase we implement new game and time/move counting. After that we can check time and moves used to solve puzzle. Create new game when ever player wants to start new game. In the last phase we implement instructions, high score, device movement control system and get image on the web. We can remove or change priority if we think we can get better solution.

We design a class diagram and in the first phase it contains only main classes and some attributes and operation. First class diagram gives idea about the game architecture. During this week we modify class diagram so it is equal with the implementation or we find out more classes, attributes or operations.

Design

Screen shots

Project Artefacts

Presentation slides

Report document

Source Package

How to run software

Unzip eightPuzzle_V7.zip file to the selected folder on your computer. Start the Nokia Qt Creator and open the eightPuzzle project folder and from there start the eightPuzzle QtProjectfile. Package contains source code and two puzzle images. You can change image by pressing select image button, finding image and loading it. You can play the game by pressing pieces or by rotating the phone.

Conclusion

Qt contains lot of functions which can be used but it was somehow quite hard to find what you were looking for. When we found appropriate function and got the idea how it works it was quite easy to add new features into our application.

Signals and slots was quite easy to understand and use.