This is a sample project used to help teach some quick programming concepts and helps students create a project that will auto-deploy and be ready for them to share with others.
Track your progress with the project by updating the checkmarks down below
- Read this readme <<<<<<< HEAD
- Fork this project into your own Github project
- Confirm that your website is auto-deployed to https://Ninjabuilderpro.github.io/Snake-Game/game
- Make sure to update the
{username}texts on the line above to your github username
- Make sure to update the
- Make sure the following are installed (Two of these will already be installed on computer sets up for robotics)
- Install node packages
npm installin a command line window - Start the server locally:
npm run dev - Browser to the local server: http://localhost:3000/ =======
- Fork this project into your own Github project
- Confirm that your website is auto-deployed to GitHub Pages
- Make sure to update the
{username}text on the line above to your github username
- Make sure to update the
- Make sure the following are installed (Two of these will already be installed on computer sets up for robotics)
- Install node packages
npm installin a command line window - Start the server locally:
npm run dev - Browser to the local server: http://localhost:3000/
060ece02456937ad2b22c1420c7f73e23884365b
All these changes can be made in ./game/studentCode.ts
- getGridSize - you can change it from 10 to something, to see how it changes, but return to 10 after
- getBoardSpeedMs - we can explain it, but we will need to go back to it after the snake is moving
- createApple - change from going to the first cell to a random cell
- getDirection - we can explain how switch statements work and enums (for the Direction enum)
All these changes can be made in ./game/studentCode.ts
- Handle moving the snake head from the direction passed in
- Detect collision with a wall
- Detect collision with an apple
- Handle consuming an apple
- Add default body parts
- Handle updating the snake body when the head moves
- Detect collisions with the body
- Update background for the apple to
./game-assets/apple.png - Update image parts for the snake
This is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!