Giter VIP home page Giter VIP logo

mines3d's Introduction

Mines3D

Minesweeper on n*m*2 matrix for Android. The goal of the game is to find all of mines and mark them with a long press. When you double-tap on field without a mine[x, y, z], you will get the number of mines in neighbor fields (if they exist) [(x-1), y, z], [(x+1), y, z], [x, (y-1), z], [x, (y+1), z], [x, y, (z+1) mod 1]. If you double-tap on a field with mine, the game will end.

There are 5 modes with possible extensions.

  1. 5x5x2 with 7 mines
  2. 8x8x2 with 16 mines
  3. 10x10x2 with 25 mines
  4. 12x12x2 with 50 mines
  5. 15x15x2 with 90 mines

Installation

Download from Google Play Get it on F-Droid

Screenshots

More screenshots can be found in this folder.

Development

Prerequisites

  • Android Studio 2023.1.1
  • A device with Android newer than 4.4

Building and running

Download the repository and open the root folder as a project in Android Studio. Do Grandle sync, and clean and build. After that, you should be able to build it and either run it on your device or VM.

License

This project is licensed under the GPL-3.0 License - see LICENSE.md file for details

Code description

Activities

The MainActivity is the menu, which is shown first. The GameActivity contains a view, of where the game is played.

Static class - LoadedGame

To prevent bugs coming from Android tendencies of endless reinitializations of Activity classes, the game data were moved to the static class LoadedGame. There are no limitations coming from that because only one game can be played at the same time.

There are saved 3 instances of 3 classes: GameStatus, MinesContainer, Activity (the last MainActivity loaded)

Package - cos.premy.mines

You can find here the elemental classes of the program.

  • LoadedGame - ...
  • MyHappyException - Exception class for throwing exceptions specific to this program
  • Utils - Any generally useful code
  • MainActivity - An activity class, that defines the modes of the game
  • GameStatus - The status of the running game. (things like the time of a start)

Package - cos.premy.mines.graphics

  • GameActivity - An activity class, which runs a game view
  • IDrawable - Interface, which is implemented by all of the game components
  • MinesView - The view in GameActivity, in which are initialized, drawn, updated,... all of IDrawable
  • Grid - It draws the grid and sends commands to mine fields.
  • MineField - It draws one of mines. One instance is always paired with only one mine and with one MineField[x][y][(z+1)mod 1].
  • MinesLayoutComputor - Stuff like the margin of the grid, size of the grid,...
  • StatusLabel - The text in the left corner.
  • SwitchButton - The button, which switches the level(z) of the grid.

Package - cos.premy.mines.graphics.animations

It takes care of animations in the program. It is easily understandable from the code.

Package - cos.premy.mines.generator

  • MinesGenerator - Interface for problem generator
  • RandomMinesGenerator - The actual generator of all problems.

Package - cos.premy.mines.data

  • Mine - the container for storing information about one mine
  • MinesContainer - the container for storing Mine

mines3d's People

Contributors

stastnypremysl avatar translucentsabre avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.