Skip to content

iheathers/Coin-Game-DOM-Manipulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Coin Game Starter

A fun, interactive game where the player uses the arrow keys to move an avatar and collect coins. Each time the avatar collects a coin, the score increases, and the coin moves to a new random position on the screen.

You can play the game live here: Coin Game - DOM Manipulation

Gameplay Screenshot

How to Play

  1. Desktop:

    • Use the arrow keys to move the avatar.
      • Arrow Up: Move the avatar up.
      • Arrow Down: Move the avatar down.
      • Arrow Right: Move the avatar to the right.
      • Arrow Left: Move the avatar to the left.
  2. Mobile:

    • Swipe in the direction you want to move the avatar.
    • The avatar will follow the swipe direction (up, down, left, right).
  3. When the avatar touches the coin, the score increases by one point, and the coin moves to a new random location.

  4. Try to collect as many coins as possible!

Features

  • Responsive avatar movement with keyboard arrow keys and touch events.
  • Random coin positioning when the coin is collected.
  • Keeps track of and displays the score.

Files

  • index.html: Contains the HTML structure for the game.
  • app.css: Styles the game elements.
  • app.js: Contains the logic for avatar movement, collision detection, and score updating.

Installation

  1. Clone the repository:

    git clone <repo>
  2. Open the index.html file in your browser to start playing the game.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Future Improvements

  • Add more coins or different collectibles.
  • Implement sound effects when collecting coins.
  • Create levels or challenges with increasing difficulty.

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published