Skip to content

PhileasL/LightOut_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LightOut Game

A school project of a student in ECAM Brussels.

The goal is to reproduce the goal board by changing the state of the Piece by clicking them. Be careful, when pressing a Piece, the neighours are also affected ! You have a given number of actions to do, complete the game within this number of action or else you'll have to retry !

Make it runs on your computer

This little game was made for Windows OS.

  • Clone this repo,
$ git clone https://github.com/PhileasL/LightOut_Game.git
  • Load this project in Unity,
  • Before running it, you have to define the scene order in the "Build Bettings" window,

File -> Build Settings... In unity explorer, go to: Assets/Scenes/ Drag an drop MenuScene first and then PlayScene into "Scenes In Build" of "Build Settings" window

  • Load the MenuScene in your editor (by double-clicking it),
  • Run it !

Architecture

A brief explaination of what you'll find in the Assets folder.

  • Ressources Contains all the ressources used in the project (images, gradients, textures, prefab objects).

  • Scenes Contains the two scenes of the game, with their initial hierarchy.

  • Scripts Contains the code of this project.

Working principe of the code

Menu

The menu scene is binded to the MainMenu class which is its supervisor. Preview in the Options is generated by an instance of Rules which generate a Board according to the parameters given by the player. While pressing play, the options parameters are stored by PlayerPrefs.

Game initialization

While the PlayScene is loaded, the initialization of the game is done by LightOut class which is the supervisor of the whole game. It instanciates Rules for this session of game which generate two Boards instances, one is the goal, the other one is the game board.

A Board knows by its constructor arguments weither if it's a game board or a goal board (important for its positionning) and its size (the number of Pieces on a side). Then, it generates a Plane and the Pieces according to the size.

Pause Menu

By pressing esc or Pause button, you can enter the Pause Menu which is supervised by PauseMenu. You can either retry this session of game, return to menu, quit the game or resume the game.

This screen is also the screen of end and fail.

Game

Rules instanciates Actions containing the different actions that can occurs in the game such as being above the board and highlight the concerned Pieces, changing the state of Pieces and so on. The supervisor of the game calls actions'functions when needed.

At each press of the player on the game board, the actions remaining number is decreased, if the number equal zero and the goal state isn't reached, the fail screen appears. In the case of the goal state reached, the end screen pops.

Default values of the game

All the default values of the game can be found in UnityParams.

Tests

Only one unitary test is written, CartesianTest.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published