Skip to content

yahayuta/classic_games_app

Repository files navigation

Classic Games App

A Flutter application featuring classic arcade games like Asteroids and Pong, built with the Flame engine. Includes an engaging main menu, keyboard controls, and on-screen touch controls for mobile play.

Features

  • Main Menu: A beautiful and engaging main menu to select a game.
  • Asteroids: The classic space-shooter game.
    • Fly your ship through a dangerous asteroid field.
    • Shoot and destroy asteroids.
    • Avoid collisions to survive.
  • Pong: The classic table tennis game.
  • Tetris: The iconic falling block puzzle game.
    • Clear lines by completing rows of blocks.
    • Strategize with next and held pieces.
    • Increasing difficulty with levels.
  • Breakout: The classic brick-breaking game.
    • Destroy all bricks with the ball.
    • Control the paddle to keep the ball in play.
    • Progress through levels with increasing difficulty.
    • Score points for broken bricks and paddle hits.
  • Space Invaders: The timeless arcade shooter.
    • Defend against waves of alien invaders.
    • Shoot down enemies and avoid their fire.
    • Progress through increasingly difficult stages.
  • Missile Command: The classic city defense game.
    • Defend your cities from incoming missiles.
    • Single base with unlimited ammo.
    • Progress through waves of increasing difficulty.
  • Snake: The classic game where you control a growing snake.
    • Eat the food to grow longer.
    • Avoid hitting the walls or your own body.
  • Frogger: The classic game where you guide a frog to safety.
    • Cross a busy road and a hazardous river.
    • Avoid cars and jump on logs and turtles.

Screenshots

Main Menu

A grid-based menu with icons and descriptions for each game.

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Installation

  1. Clone the repo
    git clone https://github.com/<your-username>/classic_games_app.git
  2. Install packages
    flutter pub get

Running the App

You can run the app on a connected device, simulator, or the web.

  • Run on a connected device or simulator:
    flutter run
  • Run on Android Emulator/Device:
    1. Ensure an Android emulator is running or a device is connected (flutter devices).
    2. Run the app targeting the device ID:
      flutter run -d <device_id>
      (e.g., flutter run -d emulator-5554)
  • Run on the web:
    flutter run -d chrome
    or
    flutter run -d edge
    If you have trouble launching a browser, you can use the web server option:
    flutter run -d web-server
    This will start a local server. You can then open the provided URL in your browser.

How to Play Asteroids

  • Keyboard Controls:
    • Arrow Left: Turn left
    • Arrow Right: Turn right
    • Arrow Up: Thrust
    • Space Bar: Shoot
  • On-screen Controls (for touch devices):
    • Left Button: Turn left
    • Right Button: Turn right
    • Thrust Button: Thrust
    • Fire Button: Shoot

How to Play Pong

  • Keyboard Controls:
    • Player 1 (Left Paddle): 'W' to move up and 'S' to move down.
    • Player 2 (Right Paddle): Arrow Up and Arrow Down keys to move.
  • On-screen Controls (for touch devices):
    • Player 1 Up Button: Move Player 1 paddle up
    • Player 1 Down Button: Move Player 1 paddle down
    • Player 2 Up Button: Move Player 2 paddle up
    • Player 2 Down Button: Move Player 2 paddle down

How to Play Tetris

  • Keyboard Controls:
    • Arrow Left: Move piece left
    • Arrow Right: Move piece right
    • Arrow Down: Soft drop (move piece down faster)
    • Arrow Up: Rotate piece
    • Space Bar: Hard drop (instantly drop piece)
    • H: Hold piece
    • Enter: Restart game (after Game Over)
  • On-screen Controls (for touch devices):
    • <- Button: Move piece left (press and hold for continuous movement)
    • -> Button: Move piece right (press and hold for continuous movement)
    • Rot Button: Rotate piece
    • Drop Button: Hard drop

How to Play Breakout

  • Keyboard Controls:
    • Arrow Left: Move paddle left
    • Arrow Right: Move paddle right
  • On-screen Controls (for touch devices):
    • Left Button: Move paddle left (press and hold for continuous movement)
    • Right Button: Move paddle right (press and hold for continuous movement)
    • Restart: Press any key or tap the screen after Game Over.

How to Play Space Invaders

  • Keyboard Controls:
    • Arrow Left: Move left
    • Arrow Right: Move right
    • Space Bar: Shoot
  • On-screen Controls (for touch devices):
    • Left Button: Move left
    • Right Button: Move right
    • Fire Button: Shoot

How to Play Missile Command

  • Objective: Defend your six cities from a barrage of incoming enemy missiles.
  • Controls:
    • Tap/Click: Tap or click on the screen to launch a missile from your central base to that location. The missile will create an explosion that destroys any enemy missiles within its blast radius.
  • Gameplay:
    • You have a single missile base with unlimited ammo.
    • The game progresses in waves, with each wave getting progressively harder.
    • The game is over when all of your cities are destroyed.

How to Play Snake

  • Keyboard Controls:
    • Arrow Keys: Control the direction of the snake.
  • On-screen Controls (for touch devices):
    • Directional Buttons: Control the direction of the snake.
  • Restart:
    • After Game Over, press SPACE or tap any on-screen button to restart.

How to Play Blackjack

  • Objective: Get a hand value as close to 21 as possible without going over.
  • On-screen Controls (for touch devices):
    • Hit Button: Draw a new card.
    • Stand Button: End your turn.
    • New Game Button: Appears after a round is over to start a new game.

How to Play Frogger

  • Keyboard Controls:
    • Arrow Keys: Move the frog up, down, left, or right.
  • On-screen Controls (for touch devices):
    • Directional Buttons: Move the frog.
  • Restart:
    • After Game Over, press the "Restart" button.

Recent Improvements

  • Frogger Game:
    • Added the classic Frogger game.
    • Fixed a bug where the game would freeze upon collision with an obstacle.
    • Added a "Game Over" screen with a "Restart" button.
    • Removed debug overlays and console logs.
  • Blackjack Game:
    • Implemented a touch interface with on-screen buttons for "Hit", "Stand", and "New Game".
    • Improved button styling and fixed rendering issues to ensure visibility.
    • Refactored background rendering for better performance and reliability.
    • Removed keyboard controls to create a touch-only experience.
  • Missile Command:
    • Simplified the game to a "Single Base Defense" model with one central base and infinite ammo.
    • Implemented a robust collision detection system using Flame's built-in engine.
    • Improved the visibility of both player and enemy missiles.
    • Fixed various bugs related to game logic and UI.
  • Breakout Game: Added the classic Breakout game with levels, score, lives, sound effects, and both keyboard/on-screen controls. Fixed critical layout and logic bugs, and tuned paddle width and ball speed.
  • On-screen left and right movement buttons now support "press and hold" for continuous movement.
  • Resolved issues with on-screen controls not appearing and the game starting directly on the "Game Over" screen.

Built With

  • Flutter - The UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase.
  • Flame - A minimalist Flutter game engine.

About

A Flutter application featuring classic arcade games like Asteroids and Pong, built with the Flame engine. Includes an engaging main menu, keyboard controls, and on-screen touch controls for mobile play.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors