Skip to content

Phaser and Tauri Project Template using Snake as a starting point

License

Notifications You must be signed in to change notification settings

mikesnoeren/phaser-tauri-snake

Repository files navigation

Phaser and Tauri Project Template

This repository serves as a starting point for developing applications using Phaser, a popular javascript framework for building games, alongside Tauri, a toolkit for building lightweight, secure, and cross-platform desktop applications with web technologies. The project is bundled using Vite, a modern front-end build tool that significantly improves the development experience.

In this template, you'll find a working version of the classic Snake game. Please note that some code may be opinionated, such as the UI being done in HTML instead of being done directly in Phaser. This approach allows for greater flexibility and customization, but feel free to adapt it to your preferred method.

Prerequisites

  • Node.js & npm
  • Rust

Getting Started

  1. Create a new repository from this template
    Click on the green "Use this template" button. This will create a new repository in your GitHub account with the same files and structure as this template.

  2. Install dependencies
    Navigate to your local repository and install dependencies using npm install

  3. Start the development server
    Run npm run dev in your local repository to start the Vite local development server. This server will automatically reload the page when you make changes to the source code. Alternatively, you can run npm run tauri dev. This command performs the same function as the previous one but launches the application in a Tauri window instead.

Building the Project

There are two main ways to build the project:

  • Building for the Web
    To build the project for web deployment, run npm run build. This command compiles the project into static files for production. The output will be in the ./dist directory, ready to be uploaded to any web server.

  • Building for Desktop with Tauri
    To build the project for desktop platforms, follow these steps:

    • Update the package.version variable in your tauri.conf.json file accordingly before building. This ensures that the version of your application is correctly reflected in the build

    • Merge your changes into the release branch (or create it if it doesn't exist yet). This step triggers the tauri-action GitHub Action

The tauri-action GitHub Action will then build the application for all major operating systems (Windows, macOS, Linux) and create a release for them on GitHub.

Contributing

This project serves as my personal starting point for new projects, and I'm thrilled to share it with the community! If you're interested in contributing to this project, please start by opening an issue to discuss your proposed changes or additions. This helps me coordinate and ensure that your contributions align with the project's goals and standards.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Future Plans

As the development of the Phaser and Tauri Snake Game Template progresses, several exciting updates and enhancements are on the horizon. Here's a glimpse into what's coming:

  1. Enhanced Snake Game Demo
    The snake game demo will be expanded with new features and gameplay mechanics, including new levels and modes. This update aims to showcase the project structure for more advanced games, helping new developers understand how to build complex projects.

  2. Multiplayer Capabilities
    To add a social element to the game, multiplayer functionality will be integrated using socket.io. This will enable players to compete against each other in real-time, adding a competitive edge to the game.

  3. Tauri v2 and Cross-Platform Builds
    With the upcoming release of Tauri v2, the template will be updated to leverage the latest features and improvements. Additionally, efforts will be made to support builds for iOS and Android, broadening the game's reach to mobile platforms.

About

Phaser and Tauri Project Template using Snake as a starting point

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published