Git Product home page Git Product logo

minesweeperfx's Introduction

So the GUI has a MenuBar witch contains 2 options for different difficulties. The third one doesn't work for some reason
Each time the user changes difficulty everything is set to new and the scene gets updated with the new GRID.
The GUI is kept up to date with a refresh method which goes through the whole minefield object and if a mine has been reveled the Button text gets updated to the number of mined neighbours, after it checks if everything was revealed/flagged and if so the winning dialog pops up. The data is fecthed from the 'old' Minefield object simply by having the buttons coordinates match with the tiles on the field.
Each interaction with the GUI (Left/Right Click) will correspond to an alteration to the original Minefield object.
The user can left/right click a tile.
Left click will trigger the step method, if you step on a tile a defeat dialog pops up asking for a new game or quit.
Right click will place a flag img ontop on the button to mark a tile (must flag every mine tile to win). Incorrectly placed flags can be removed with another right click.
Each button as an inner EventHandler to handle the left/right click event
There's a boolean 2D array to keep track of which button has a flag img and need to be removed.

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.