- Install Node.js and Visual Studio Code.
- Open the project in Visual Studio Code.
- Open a terminal (Terminal > New Terminal).
- run
npm install
. If it failed for any reason, try again. - run
npm run watch
. - 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
.
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.
This game is controlled with WASD keys on the keyboard for moving forward, left, backward, right respectively.
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.