-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,188 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
tags: [ '*' ] | ||
|
||
jobs: | ||
compile: | ||
name: Compile | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
include: | ||
- os: windows-latest | ||
ext: '.exe' | ||
- os: ubuntu-latest | ||
ext: '' | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Install Linux Packages | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get install -y libgl1-mesa-dev xorg-dev | ||
|
||
- name: Compile | ||
run: | | ||
mkdir -p "./dist/${{ matrix.os }}" | ||
go build -o "./dist/${{ matrix.os }}/rally-mka${{ matrix.ext }}" ./cmd/rallymka/ | ||
- name: Archive Distribution | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Distribution | ||
path: ./dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,9 @@ | |
|
||
# Assets | ||
/assets | ||
|
||
# VSCode | ||
.vscode/ | ||
|
||
# Distribution | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,99 @@ | ||
# Rally MKA [![Go Report Card](https://goreportcard.com/badge/github.com/mokiat/rally-mka)](https://goreportcard.com/report/github.com/mokiat/rally-mka) [![Go Reference](https://pkg.go.dev/badge/github.com/mokiat/[email protected])](https://pkg.go.dev/github.com/mokiat/rally-mka@master) | ||
|
||
Rally MKA is a really old game of mine ported to Go for fun and as a way to try new concepts out. | ||
Rally MKA is a really old game/demo of mine ported to Go for fun and as a way to experiment with new concepts. | ||
|
||
![Game Screenshot](preview.png) | ||
[![Game Screenshot](preview.png)](http://mokiat.com/rally-mka/) | ||
|
||
## User's Guide | ||
|
||
Check the [Releases](https://github.com/mokiat/rally-mka/releases) section for ready-to-use binaries. | ||
### Browser | ||
|
||
Use the following link to try the game in the browser: | ||
http://mokiat.com/rally-mka/ | ||
|
||
The preferred browser is [Chrome](https://www.google.com/chrome/), which at the time of writing appears to best support WebGL2, WebAssembly and Game Controllers. | ||
|
||
### Desktop | ||
|
||
Check the [Releases](https://github.com/mokiat/rally-mka/releases) section for ready-to-use binaries that you can use on your computer. | ||
|
||
The requirement is that your OS supports `OpenGL 4.6`. | ||
|
||
### Controls | ||
|
||
Use the following keyboard keys when playing: | ||
|
||
- `Left Arrow` - Steer left | ||
- `Right Arrow` - Steer right | ||
- `Up Arrow` - Accelerate | ||
- `Down Arrow` - Decelerate | ||
- `a`, `s`, `d`, `w` - Rotate camera | ||
- `q`, `e` - Zoom in/out camera | ||
- `Enter` - Flip car | ||
|
||
In addition, the game supports using a Game Controller. | ||
|
||
## Developer's Guide | ||
|
||
This section describes how to setup the project on your machine and compile it yourself. | ||
|
||
### Prerequisites | ||
|
||
* You need [Go 1.16](https://golang.org/dl/) or newer. | ||
* You need the [Git LFS](https://git-lfs.github.com/) plugin. As the project contains large images and models, this is the official way on how not to clog a repository. | ||
* Follow the instructions on the [GLFW for Go](https://github.com/go-gl/glfw) repository and make sure you can run the [GLFW examples](https://github.com/go-gl/example) on your platform. | ||
- You need [Go 1.18](https://golang.org/dl/) or newer. | ||
- You need the [Git LFS](https://git-lfs.github.com/) plugin. As the project contains large images and models, this is the official way on how not to clog a repository. | ||
- Follow the instructions on the [GLFW for Go](https://github.com/go-gl/glfw) repository and make sure you can run the [GLFW examples](https://github.com/go-gl/example) on your platform. | ||
- Make sure you have [Task](https://taskfile.dev/) installed, as this project uses Taskfiles. | ||
|
||
### Setting Up | ||
|
||
1. Clone the repository | ||
|
||
```sh | ||
git clone https://github.com/mokiat/rally-mka | ||
cd rally-mka | ||
``` | ||
```sh | ||
git clone https://github.com/mokiat/rally-mka | ||
cd rally-mka | ||
``` | ||
|
||
1. Download Go dependencies | ||
|
||
```sh | ||
go mod download | ||
``` | ||
```sh | ||
go mod download | ||
``` | ||
|
||
1. Generate game assets | ||
|
||
```sh | ||
make assets | ||
``` | ||
```sh | ||
task pack | ||
``` | ||
|
||
#### Desktop | ||
|
||
1. Run the game | ||
|
||
```sh | ||
make play | ||
``` | ||
```sh | ||
task run | ||
``` | ||
|
||
#### Browser | ||
|
||
1. Generate web content | ||
|
||
```sh | ||
task webpack | ||
``` | ||
|
||
1. Build web assembly executable | ||
|
||
```sh | ||
task wasm | ||
``` | ||
|
||
1. Run HTTP server | ||
|
||
```sh | ||
task web | ||
``` | ||
|
||
1. Open http://localhost:8080 | ||
|
||
## Licensing | ||
|
||
|
@@ -53,14 +103,16 @@ All source code in this project is licensed under [Apache License v2](LICENSE). | |
|
||
### Assets | ||
|
||
Assets (images, models, textures, etc.), are distributed under the [Creative Commons Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) license. | ||
Assets (images, models, textures, etc.) are distributed under the [Creative Commons Attribution 4.0 International](http://creativecommons.org/licenses/by/4.0/) license. | ||
|
||
## Special Thanks | ||
|
||
The following projects and individuals have contributed significantly to the project: | ||
|
||
* **[GLFW for Go](https://github.com/go-gl/glfw)** for making it possible to use GLFW and OpenGL in Go. | ||
* **[LearnOpenGL](https://learnopengl.com/)** for the amazing tutorials. | ||
* **[TextureHeaven](https://texturehaven.com/)** for the excellent free images. | ||
* **[Erin Catto](https://github.com/erincatto)** for all the presentations and articles that were used as reference. | ||
* **[Bo0mer](https://github.com/Bo0mer)** for the panoramic image that was used to generate the original `city` skybox images. | ||
- **[The Go Team](https://go.dev/)** for making Go programming language. | ||
- **[GLFW for Go](https://github.com/go-gl/glfw)** for making it possible to use GLFW and OpenGL in Go. | ||
- **[LearnOpenGL](https://learnopengl.com/)** for the amazing tutorials. | ||
- **[Poly Haven](https://polyhaven.com/)** for the excellent free images. | ||
- **[Erin Catto](https://github.com/erincatto)** for all the presentations and articles that were used as reference for the physics engine. | ||
- **[Bo0mer](https://github.com/Bo0mer)** for the panoramic image that was used to generate the original `city` skybox images. | ||
- And everyone else whose repository has been used as a dependency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
version: '3' | ||
|
||
tasks: | ||
|
||
webpack: | ||
cmds: | ||
- mkdir -p 'assets/web' | ||
- cp 'resources/icon.png' 'assets/web/favicon.png' | ||
- cp 'resources/web/main.css' 'assets/web/main.css' | ||
- cp 'resources/web/main.js' 'assets/web/main.js' | ||
- cp 'resources/web/index.html' 'assets/index.html' | ||
- cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" 'assets/web' | ||
|
||
pack: | ||
cmds: | ||
- go run './cmd/rallypack' | ||
|
||
assets: | ||
deps: [webpack, pack] | ||
|
||
run: | ||
cmds: | ||
- go run './cmd/rallymka' | ||
|
||
debug: | ||
cmds: | ||
- go run -tags debug './cmd/rallymka' | ||
|
||
wasm: | ||
env: | ||
GOOS: js | ||
GOARCH: wasm | ||
cmds: | ||
- go build -o './assets/web/main.wasm' './cmd/rallywasm' | ||
|
||
web: | ||
cmds: | ||
- go run 'github.com/mokiat/httpserv@master' -dir './assets' -host '127.0.0.1' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.