Skip to content

AhmedHisham552/CrossyRoad

Repository files navigation

Tables of Contents

How to run

  1. Install Node.js and Visual Studio Code.
  2. Open the project in Visual Studio Code.
  3. Open a terminal (Terminal > New Terminal).
  4. run npm install . If it failed for any reason, try again.
  5. run npm run watch .
  6. Ctrl + click the link shown in the terminal (usually it will be http://localhost:1234).

Note: you can use yarn to enable caching so that you don't download all the packages with project. You can download yarn from yarnpkg.com. Then replace npm install with yarn install and npm run watch with yarn watch.

Game rules

You're playing with a pig, you need to reach the end of the map to win, it sounds simple but becareful from the hungry dogs crossing the street, they will eat you whenever they can and then you'll restart from the beginning.

Game controls

This game is controlled with WASD keys on the keyboard for moving forward, left, backward, right respectively.

Screenshots

Design your own level

You can design your own level by using level maps.

  • Make a level map like the example shown below in a txt file
  • TTTGGGGGGGGGGGGGGGGGGGGGGGGGGTTT RRRRRRRRRFRRRRRRRRRFRRRRRRRRFRRR RRRRRRFRRRRRRRFRRRRRRRRRRRRRRRRR TTTGGGGGGGGGGGGGGGGGGGGGGGGGGTTT RRRRRRFRRRRRRRFRRRRRRRRRRRRRRRRR TTTGGGGGGGGGGGGGGGGGGGGGGGGGGTTT
  • The level map encoding is as follow
    • (T) for trees
    • (R) for Road
    • (G) for grass
    • (F) for initial dog locations
  • Then load your desired level map by changing inputLevel path in CrossyRoad.tsx to the desired input level.

About

A Clone of Crossy Road game implemented using WebGL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages