Code Monkey home page Code Monkey logo

scratch-and-win-game-flutter's Introduction

scratch_and_win_game_flutter

A simple scratch and win game where you have a grid of 25 blocks out of which only one block has the prize and you win when you find the correct one. About the app
This Flutter app allows the user to select any 5 block from the total 25 present out of which only one has the prize. If you figure out which block it is on or before 5th try then you win, else you lose and the game will reset itself. It's a game of Luck. Good Luck!
I was inspired to make this game after seeing one of my friend make this.
The initial screen has two buttons taking you to the game or rules respectively.
Things which are donw in this app invove:-

  • Stateful and stateless widget
  • layout building
  • Various images display
  • Audioplayer and audio cache
  • Raised buttons
  • List Grid view etc.
  • Navigator

Logic:- When the game will load a random number will be generated automatically on which the cash image will be displayed which will make you win.
The 25 boxes which are also displayed are buttons which will be triggered when we press them and are stored in the list. These buttons have a index number which is matched with the random to decide whether we win or loose.
Another variable count is there which keeps the track of count/ your chances.
We have a reset button which will be resetting the game if you want to start from the beginning.
Different text are also displayed in the Text view according to the state of the game.
Audios are also played accordingly.
Show all button is responsible for showing all the images on the blocks.


Built using:-

  • Flutter

Some snaps from the app:-
Full video:- https://youtu.be/pYy_gR2oxlc
Initial screen rules Empty boxes first click Show all triggered Game lost Game won

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

scratch-and-win-game-flutter's People

Contributors

harshkumarkhatri avatar

Watchers

 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.