Giter VIP home page Giter VIP logo

dino_game_clone's Introduction

Dino Run Game

This is a simple browser-based Dino Run game implemented in JavaScript and HTML/CSS. The game allows the player to control a dinosaur character and avoid obstacles (cacti) to achieve the highest possible score.

Getting Started

To run the game locally on your machine, follow these steps:

  1. Clone the repository to your local machine:

    git clone <repository_url>
  2. Open the project folder in your code editor.

  3. Open index.html in your web browser to play the game.

How to Play

When you open the game, you'll see a start screen with the message "Press any key to Start."

Press any key to start the game. The game screen will appear, and you'll control a dinosaur character. Use the spacebar key to make the dinosaur jump over obstacles (cacti). The game keeps track of your score, which increases as you survive longer. If the dinosaur collides with an obstacle, the game ends, and a "Game over" screen appears with your final score. Press any key to restart the game. Code Structure The game code is organized into three main modules: ground.js, dino.js, and cactus.js, each responsible for different aspects of the game.

The game world has a fixed width and height (WORLD_WIDTH and WORLD_HEIGHT) and adjusts to the screen size.

The game loop is handled by the update function, which updates the game elements, checks for collisions, and updates the score.

Acknowledgments

This game is inspired by the classic Chrome Dino Run game.

dino_game_clone's People

Contributors

danilaostrovskiy 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.