Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

feature/lots-of-updates #110

Merged
merged 118 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
3b24540
room: delete unused code and simplify
silbinarywolf Feb 19, 2019
957a736
alarm: move alarm code to its own package
silbinarywolf Feb 19, 2019
511928b
gmlgo: add SetSize to RoomInstanceIndex, add IsRunning to alarm packa…
silbinarywolf Feb 24, 2019
8fd34bb
gmlgo: remove unused layer index code and add code to marshal binary …
silbinarywolf Mar 3, 2019
bfedb51
gmlgo: update to use internal struct
silbinarywolf Mar 4, 2019
552f37f
camera: add CameraSetUpdateFunction
silbinarywolf Mar 5, 2019
0280531
instance: start on InstanceRestore functionality (to bring old instan…
silbinarywolf Mar 8, 2019
ea03abb
gmlgo: update serialization logic, change InstanceExists to not requi…
silbinarywolf Mar 9, 2019
9498773
gmlgo: update camera
silbinarywolf Mar 9, 2019
fecad2f
alarm: add gob serialization of alarm
silbinarywolf Mar 12, 2019
ce56b83
gmlgo: add "gmlgo build" command, remove unused "gmlgo fix" command c…
silbinarywolf Mar 16, 2019
ff95eaa
gmlgo: remove cobra and add simple tests
silbinarywolf Mar 17, 2019
374a29c
gmlgo: change marshalling of structs to just use binary encoding (les…
silbinarywolf Mar 20, 2019
54da492
gmlgo: add manual serialization to various object related structs
silbinarywolf Mar 25, 2019
5729f49
gmlgo: more work on serialization
silbinarywolf Mar 26, 2019
9247ded
gmlgo: start on generating serialization code
silbinarywolf Mar 26, 2019
e9596a1
gmlgo: more work on generating serialization code
silbinarywolf Mar 28, 2019
28e9f66
gmlgo: basic serialization code working
silbinarywolf Mar 29, 2019
414cddc
gmlgo: add tests for build
silbinarywolf Mar 31, 2019
c1bf12d
gmlgo: add test for serialization error case
silbinarywolf Mar 31, 2019
9b4e76e
gmlgo: adjust code generation to only import certain packages if thei…
silbinarywolf Mar 31, 2019
deb9067
gmlgo: fix generating serialization code for int type
silbinarywolf Mar 31, 2019
4ede3a2
gmlgo: remove debug log functions
silbinarywolf Apr 1, 2019
5b814b1
gmlgo: fix DrawSpriteRotated in tests (headless) and fix tags being p…
silbinarywolf Apr 2, 2019
173b53b
gmlgo: update sprite updating to work like Game Maker Studio 2
silbinarywolf Apr 3, 2019
b9fff42
gmlgo: update asset system to be more flexible (allow nesting assets …
silbinarywolf Apr 6, 2019
faa2d8a
gmlgo: fix config loading not working
silbinarywolf Apr 8, 2019
9c1f591
gmlgo: update code generation of asset IDs to generate into the "asse…
silbinarywolf Apr 8, 2019
cfc5cd7
gmlgo: fix code generation tests
silbinarywolf Apr 8, 2019
9c3a99b
gmlgo: update assets to no longer auto-prefix, add error handling to …
silbinarywolf Apr 9, 2019
c6e4576
gmlgo: update DrawText to take color parameter, fix backspace key and…
silbinarywolf Apr 16, 2019
0f2b0a4
gmlgo: add support for "custom" asset folder
silbinarywolf Apr 19, 2019
2d78d93
gmlgo: fix example games
silbinarywolf Apr 19, 2019
f2c509d
gmlgo: add json tagging and add error-check to using UnsafeObjectType…
silbinarywolf Apr 19, 2019
bfc729e
gmlgo: minor fixes
silbinarywolf Apr 22, 2019
8163c78
gmlgo: add MouseScreenPosition(), expose time functions and update te…
silbinarywolf Apr 24, 2019
18c0d0e
gmlgo: add basic support for custom assets in code generation
silbinarywolf Apr 26, 2019
f611f44
go: add support for Go Modules and fix broken tests
silbinarywolf Apr 27, 2019
5a0cb4c
generate: fix go generate logic and paths provided to engine
silbinarywolf Apr 27, 2019
c70b0aa
keyboard: fix backspace speed behaviour not resetting when backspace …
silbinarywolf Apr 28, 2019
b04548b
modules: run "go mod tidy"
silbinarywolf May 12, 2019
f779874
draw: update draw text code so that smaller characters like "." and "…
silbinarywolf May 12, 2019
b38649e
travis: fix build by updating to latest go version (1.12.5)
silbinarywolf May 12, 2019
46fc319
travis: remove sonarqube and remove manually downloading dependencies
silbinarywolf May 13, 2019
123ba2a
travis: add dependencies back
silbinarywolf May 13, 2019
c0cac80
generate: fix gmlgo_gen code to work use "packages" module for Go Mod…
silbinarywolf May 15, 2019
f0f820e
travis: attempt to fix build
silbinarywolf May 17, 2019
18c14ee
generate: update comments around generate
silbinarywolf May 17, 2019
3f5757f
file: change from deprecated gopherjs/gopherwasm/js package to syscal…
silbinarywolf May 26, 2019
3a80a43
instance: fix deletion of entities to occur after GamePostUpdate and …
silbinarywolf Jun 1, 2019
1886497
vet: resolve go vet warnings
silbinarywolf Jun 2, 2019
22c08fe
vet: resolve go vet warnings #2
silbinarywolf Jun 2, 2019
6d143d5
asset: add basic asset manager system
silbinarywolf Jun 3, 2019
5615c7c
asset: make asset loading use go routines / be async
silbinarywolf Jun 3, 2019
cc582cf
asset: fix race condition that could occur if asset count was below 4…
silbinarywolf Jun 4, 2019
36b77b8
time: rename timeprec to monotime
silbinarywolf Jun 10, 2019
78d934b
debug: remove code to open now deprecated room editor
silbinarywolf Jun 10, 2019
139ceca
asset: rename LoadAll to UnsafeLoadAll, to deter users from calling t…
silbinarywolf Jun 15, 2019
2389c76
window: add WindowSetSize, WindowSetScale
silbinarywolf Jun 16, 2019
29c7838
room: improve error message
silbinarywolf Jul 8, 2019
3c76bb9
draw: add DrawRectangleAlpha function
silbinarywolf Jul 21, 2019
2a08810
gml: add GameEnd method
silbinarywolf Jul 30, 2019
2633ee2
instance: add InstancePauseAll method so that users can pause the game
silbinarywolf Aug 3, 2019
80587b2
window: add WindowCursorVisible and WindowSetCursorVisible
silbinarywolf Aug 4, 2019
86def29
gmlgo: update gmlgo to use Short descriptions if you run "gmlgo" by i…
silbinarywolf Aug 10, 2019
b131822
gmlgo: start on publish command
silbinarywolf Aug 14, 2019
0abeb6c
travis: fix xvfb
silbinarywolf Aug 15, 2019
444b8f1
travis: fix xenial
silbinarywolf Aug 15, 2019
1a43da1
travis: fix xvfb #2
silbinarywolf Aug 15, 2019
749997a
publish: more work on publish command
silbinarywolf Aug 18, 2019
a3dfec5
publish: fix publishing relative directories
silbinarywolf Aug 18, 2019
e1b0b85
travis: run gmlgo publish on examples/spaceship
silbinarywolf Aug 18, 2019
a0b74f1
manifest: add generation of manifest.json file in debug mode
silbinarywolf Aug 26, 2019
72dd992
manifest: update index.html to preload all asset files
silbinarywolf Aug 26, 2019
7408465
manifest: fix preload warnings in Chrome
silbinarywolf Aug 29, 2019
e1bcc89
window: add IsBrowser will return true if the game is playing in a br…
silbinarywolf Sep 1, 2019
90774bf
worm: fix sound not playing and add asset/manifest.json to .gitignore
silbinarywolf Sep 3, 2019
6e7ade8
chore: update documentation, rename example/ to example/ and various …
silbinarywolf Sep 8, 2019
839fee1
gmlgo: improve error messages with gmlgo publish
silbinarywolf Sep 8, 2019
6ddec97
gmlgo: improve error messages with gmlgo publish #2
silbinarywolf Sep 8, 2019
d7c7543
gmlgo: only publish for the current platform and web
silbinarywolf Sep 8, 2019
cdeef1a
uid: add snowflake uid generation
silbinarywolf Sep 8, 2019
093403a
instance: Add InstanceFree function for freeing an instance without t…
silbinarywolf Sep 12, 2019
bb134a3
gmlgo: update "gmlgo generate" to follow standard generated code conv…
silbinarywolf Sep 14, 2019
75211d3
test: add code to ensure asset dir exists for tests
silbinarywolf Sep 15, 2019
6cbeda5
test: add code so that tests can run headed
silbinarywolf Sep 15, 2019
696688a
test: update documentation around testing
silbinarywolf Sep 15, 2019
d947c2a
publish: improve error message
silbinarywolf Sep 15, 2019
d2afb5a
camera: fix camera rendering jankily
silbinarywolf Sep 17, 2019
3986a63
steam: add paniccatch to log out crashes to files (for debugging stea…
silbinarywolf Sep 27, 2019
b72e7d2
draw: add DrawSpriteCutMask method to allow for masking
silbinarywolf Sep 28, 2019
dc591c1
instance: simplify InstanceCreate code
silbinarywolf Sep 28, 2019
ad07b54
draw: remove DrawTextColor as it duplicated DrawText
silbinarywolf Oct 19, 2019
37e759a
git-actions: add config
silbinarywolf Oct 19, 2019
8e12fa6
mac: fix various bugs with Mac build
silbinarywolf Oct 19, 2019
2b6af35
git-actions: fix PATH to access /usr/local/go/bin
silbinarywolf Oct 19, 2019
814b193
git-actions: fix gl
silbinarywolf Oct 19, 2019
3e387cd
git-actions: fix xvfb
silbinarywolf Oct 19, 2019
7bd2e4a
git-actions: add libglfw3-dev
silbinarywolf Oct 19, 2019
07b4aa4
git-actions: xvfb
silbinarywolf Oct 20, 2019
4bfaf85
git-actions: fix actions
silbinarywolf Oct 20, 2019
4a33c01
git-actions: fix publish
silbinarywolf Oct 20, 2019
b93ef56
git-actions: try improve error messages
silbinarywolf Oct 20, 2019
27de09f
git-actions: try improve error messages 2
silbinarywolf Oct 20, 2019
6d34209
git-actions: disable publish as it fails
silbinarywolf Oct 20, 2019
a49219d
git-actions: try setup windows
silbinarywolf Oct 20, 2019
92aeffa
git-actions: try fix windows
silbinarywolf Oct 20, 2019
0c35dae
git-actions: try fix windows
silbinarywolf Oct 20, 2019
c1f59cb
git-actions: try fix windows 3
silbinarywolf Oct 20, 2019
60220b8
git-actions: try fix windows 4
silbinarywolf Oct 20, 2019
084f2c6
git-actions: try fix windows 5
silbinarywolf Oct 20, 2019
61ce264
git-actions: fix windows code coverage
silbinarywolf Oct 20, 2019
d737255
headless: fix headless
silbinarywolf Oct 21, 2019
ba4d205
git-actions: add macos
silbinarywolf Oct 21, 2019
5386429
git-actions: try fix macos
silbinarywolf Oct 21, 2019
15ae71c
git-actions: add gfx for macos
silbinarywolf Oct 21, 2019
93ccc28
git-actions: remvoe gfx for macos and add a note
silbinarywolf Oct 21, 2019
0c2af6e
remove travis badge
silbinarywolf Oct 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Go
on: [push, pull_request]
jobs:

linux:
name: Go ${{ matrix.go }} on Ubuntu
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.12']
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
id: go

- name: Set up *nix dependencies
run: |
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r"
sudo apt-get install libasound2-dev libglew-dev libgles2-mesa-dev libalut-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev

- name: Get Go dependencies
run: |
export GO111MODULE=on
go mod download
go get -v

- name: Generate and Build
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go install -v -tags debug ./gml
go install -v -tags headless ./gml
go install -v -tags "debug headless" ./gml
go install -v ./gml
go install -v ./cmd/gmlgo
gmlgo generate -v ./example/...
go build -tags debug -v ./example/...
go build -tags headless -v ./example/...
go build -tags "debug headless" -v ./example/...
go build -v ./example/...

- name: Test
run: |
export DISPLAY=:99.0
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
go test -v ./gml/...
go test -tags debug -v ./gml/...
go test -tags headless -v ./gml/...
go test -tags "debug headless" -v ./gml/...
go test -v ./cmd/...
go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=$(go list ./example/spaceship/game) ./example/spaceship/test
go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=$(go list ./example/worm/game) ./example/worm/test
# NOTE(Jake): 2019-10-20
# Publishing was failing with a vague error:
# panic: error compiling web: errors
# https://github.com/silbinarywolf/gml-go/commit/27de09fb760118ecb9b0047f6e9db3c04f603ec5/checks?check_suite_id=272768795
# - name: Publish
# run: |
# export PATH=${PATH}:`go env GOPATH`/bin
# gmlgo publish -v ./example/spaceship
windows:
runs-on: windows-latest
strategy:
matrix:
go: ['1.12']
name: Go ${{ matrix.go }} on Windows
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Get Go dependencies
run: |
echo ::add-path::%USERPROFILE%\go\bin
go mod download
go get -v

- name: Generate and Build
run: |
go install -v -tags debug ./gml
go install -v -tags headless ./gml
go install -v -tags "debug headless" ./gml
go install -v ./gml
go install -v ./cmd/gmlgo
gmlgo generate -v ./example/...
go build -tags debug -v ./example/...
go build -tags headless -v ./example/...
go build -tags "debug headless" -v ./example/...
go build -v ./example/...

- name: Test
# NOTE(Jake): 2019-10-20
# Disable headed tests on Windows as they fail
# panic: runtime error: invalid memory address or nil pointer dereference
# github.com/hajimehoshi/ebiten/internal/glfw.(*Window).GetMonitor(0x0, 0x0)
run: |
go test -tags headless -v ./gml/...
go test -tags "debug headless" -v ./gml/...
go test -v ./cmd/...
go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=github.com/silbinarywolf/gml-go/example/spaceship/game ./example/spaceship/test
go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=github.com/silbinarywolf/gml-go/example/worm/game ./example/worm/test

macos:
runs-on: macOS-latest
strategy:
matrix:
go: ['1.12']
name: Go ${{ matrix.go }} on MacOS
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Get Go dependencies
run: |
echo ::add-path::$HOME/go/bin
go mod download
go get -v

- name: Generate and Build
run: |
go install -v -tags debug ./gml
go install -v -tags headless ./gml
go install -v -tags "debug headless" ./gml
go install -v ./gml
go install -v ./cmd/gmlgo
gmlgo generate -v ./example/...
go build -tags debug -v ./example/...
go build -tags headless -v ./example/...
go build -tags "debug headless" -v ./example/...
go build -v ./example/...

- name: Test
# NOTE(Jake): 2019-10-20
# Disable headed tests on MacOS as they fail
# GLFW: An invalid error was not accepted by the caller: FormatUnavailable: NSGL: Failed to find a suitable pixel format
run: |
go test -tags headless -v ./gml/...
go test -tags "debug headless" -v ./gml/...
go test -v ./cmd/...
go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=github.com/silbinarywolf/gml-go/example/spaceship/game ./example/spaceship/test
go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=github.com/silbinarywolf/gml-go/example/worm/game ./example/worm/test
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

58 changes: 27 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
language: go

go:
- "1.11"
- "1.12.5"

# https://restic.net/blog/2018-09-02/travis-build-cache
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod

dist: xenial

addons:
sonarcloud:
organization: "silbinarywolf-github"
apt:
sources:
- ubuntu-toolchain-r-test
Expand All @@ -26,41 +26,37 @@ addons:
- libxrandr-dev
- libxxf86vm-dev

services:
- xvfb

install:
- export GO111MODULE=on
- go mod download
- go get
# Underlying framework used
- go get -t -v github.com/hajimehoshi/ebiten/...
# Used by some structures
- go get -t -v github.com/golang/protobuf/...
# Command-line library, used by "gmlgo" tool
- go get -t -v github.com/spf13/cobra/...
#- go get -t -v github.com/hajimehoshi/ebiten/...
# Debug Mode: Live file reloading (watch files for changes)
- go get -t -v github.com/fsnotify/fsnotify/...
# Debug Mode: Used for generating UUID's for room objects, etc.
#- go get -t -v github.com/rs/xid/...
#- go get -t -v github.com/fsnotify/fsnotify/...

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3

script:
- go install -tags debug -v ./gml/...
- go install -tags headless -v ./gml/...
- go install -tags "debug headless" -v ./gml/...
- go install -v ./gml/...
- go install -v -tags debug ./gml
- go install -v -tags headless ./gml
- go install -v -tags "debug headless" ./gml
- go install -v ./gml
- go install -v ./cmd/gmlgo
- gmlgo generate --v ./examples/...
- go build -tags debug -v ./examples/...
- go build -tags headless -v ./examples/...
- go build -tags "debug headless" -v ./examples/...
- go build -v ./examples/...
- gmlgo generate -v ./example/...
- go build -tags debug -v ./example/...
- go build -tags headless -v ./example/...
- go build -tags "debug headless" -v ./example/...
- go build -v ./example/...
- go test -v ./gml/...
- go test -tags debug -v ./gml/...
- go test -tags headless -v ./gml/...
- go test -tags "debug headless" -v ./gml/...
- go test -v ./cmd/...
- go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=$(go list ./examples/spaceship/game) ./examples/spaceship/test
- go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=$(go list ./examples/worm/game) ./examples/worm/test
#- go test -tags "debug headless" -coverpkg $(go list github.com/silbinarywolf/gml-go/examples/worm/game) ./...
- sonar-scanner
# NOTE(Jake): 2018-06-20
# No tests exist yet
#- go test -tags debug -v ./gml/...
#- go test -tags headless -v ./gml/...
#- go test -v ./gml/...
- go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=$(go list ./example/spaceship/game) ./example/spaceship/test
- go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=$(go list ./example/worm/game) ./example/worm/test
- gmlgo publish -v ./example/spaceship
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Game Maker Language Go

[![Build Status](https://travis-ci.org/silbinarywolf/gml-go.svg?branch=master)](https://travis-ci.org/silbinarywolf/gml-go)
[![Actions Status](https://github.com/silbinarywolf/gml-go/workflows/Go/badge.svg)](https://github.com/silbinarywolf/gml-go/actions)
[![Documentation](https://godoc.org/github.com/silbinarywolf/gml-go?status.svg)](https://godoc.org/github.com/silbinarywolf/gml-go)
[![Report Card](https://goreportcard.com/badge/github.com/silbinarywolf/gml-go)](https://goreportcard.com/report/github.com/silbinarywolf/gml-go)

**NOTE: This project is currently undergoing a large refactoring effort to help ease workflow and serialization. I'm also aiming to improve the documentation, add examples and improve test coverage. This is still just a hobby project for now!**
**NOTE: This project exists currently only for my personal use. There are no plans to ensure stability of any kind as of this time. Consider building your games with the well supported [Ebiten](https://github.com/hajimehoshi/ebiten) library.**

This is an engine that aims to strike a balance between capturing the simplicity of the Game Maker API whilst not losing any performance given to you by Go. It has been designed with multiplayer games in mind and differs itself from Game Maker by allowing you to "run" multiple rooms at once so that every player does not have to be in the same room.

![A worm jumping between two pipes](docs/images/worm1.png)
*A screenshot of the example game, [Worm in the Pipes](tree/master/example/worm)*

## Install

```
Expand All @@ -16,7 +19,7 @@ go get github.com/silbinarywolf/gml-go

## Requirements

* Golang 1.11+
* Golang 1.12.5+

## Documentation

Expand All @@ -28,4 +31,5 @@ go get github.com/silbinarywolf/gml-go

* [Hajime Hoshi](https://github.com/hajimehoshi/ebiten) for their fantastically simple 2D game library, [Ebiten](https://github.com/hajimehoshi/ebiten).
* [Yann Le Coroller](http://www.yannlecoroller.com) for their free to use Helvetica style font.
* [milkroscope](https://www.artstation.com/milkroscope) for their artwork on Worm In The Pipes (example/worm)
* [magicdweedoo](http://magicdweedoo.com/) for making the soundtrack on [Worm in the Pipes](tree/master/example/worm) example game.
* [milkroscope](https://www.artstation.com/milkroscope) for their artwork [Worm in the Pipes](tree/master/example/worm) example game.
4 changes: 4 additions & 0 deletions cmd/gmlgo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.exe
gmlgo
*.out
testdata/**/gmlgo_gen.go
67 changes: 0 additions & 67 deletions cmd/gmlgo/cmd/fix/drawpos.go

This file was deleted.

Loading