Welcome to your shiny new Codespace running Next.js! We've got everything fired up and running for you to explore Next.js.
You've got a blank canvas to work on from a git perspective as well. There's a single initial commit with the what you're seeing right now - where you go from here is up to you!
Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you’re ready you can click "Publish Branch" and we’ll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it's gone forever.
This repository contains a basic snake game implementation using React and Next.js. The game includes a scoring feature that tracks the player's score.
To run this application, follow these steps:
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the dependencies:
npm install
-
Install the new dependency:
npm install gl-matrix
-
Run the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
to see the application in action.
The game includes two modes: Default Game and No Borders Game. You can select the game mode on the home page.
The snake game includes a scoring feature that tracks the player's score. The score is incremented by 1 each time the snake eats food. The current score is displayed on the game screen above the game board.
The snake game now utilizes WebGL for GPU acceleration to handle game updates and state management. This integration leverages WebGL shaders for snake movement and collision detection, providing improved performance.
- The game logic, including snake movement and collision detection, is handled by WebGL shaders executed on the GPU.
- The rendering of the game board and elements is managed by WebGL, leveraging GPU acceleration for improved performance.
To run the game with GPU acceleration enabled, follow these steps:
- Ensure that you have installed the
gl-matrix
dependency as mentioned in the installation instructions. - Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
to see the application in action.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Create a pull request to the main repository.