Jomy10 / SnakeSwift

Snake game written in Swift. Runs on any browser using WebAssembly and on macOS with SwiftUI.

Home Page:https://snake.jonaseveraert.be

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snake Game

Snake game built using Swift, playable on any browser using WebAssembly and on macOS.

Browser

UI built using Tokamak, which is a SwiftUI compatible framework for WebAssembly. Interaction with the DOM is done through JavaScriptKit. Built and bundles using Carton.

Source code for the browser UI in WebApp.

macOS

Since Tokamak is a SwiftUI compatible framework, a Mac app can be easily created without too much adjustments.

Source code for the mac version in SnakeMacApp.

Core library

The core library contains all the game logic. This imports TokamakShim, which uses SwiftUI for compatible platforms, TokamakDOM for web and TokamakGTK for Linux. Using conditional compilation (#if), platform-specific functions are handled (e.g. using Foundation for macOS and JavaScriptKit for the web).

Contributing

If you find any bugs or have any improvement suggestions, please open an issue first. If you get green light, you can open a pull request.

If you want to work on any open issues, just comment on the issue with your intentions. If you end up not working not working on it anymore, please comment again.

License

Licensed under MIT license.

About

Snake game written in Swift. Runs on any browser using WebAssembly and on macOS with SwiftUI.

https://snake.jonaseveraert.be

License:MIT License


Languages

Language:Swift 94.6%Language:Shell 4.3%Language:HTML 0.8%Language:Python 0.3%