Please is a fun library to make an ebitengine (https://github.com/hajimehoshi/ebiten) application glitchy. It is using https://github.com/agiledragon/gomonkey to patch ebitengine functions at runtime and add extra effects to draw calls.
This is my entry for the https://itch.io/jam/ebitengine-holiday-hack-2023 jam and its theme: "bug/glitch".
go run cmd/main.go <repository_path> [relative_build_folder:optional]
Flags:
--golog
: Outputs the logs resulting fromgo
commands--mode
: Defines the level of glitchness (none,default,medium,unsafe)
go run cmd/main.go github.com/mharv/scrapyard-charter
go run cmd/main.go github.com/elamre/attractive_defense
go run cmd/main.go --mode=unsafe github.com/tinne26/transition
go run cmd/main.go github.com/ketMix/retromancer
With a relative folder to run from:
go run cmd/main.go --mode=medium github.com/hajimehoshi/ebiten/v2@latest examples/flappy
go run cmd/main.go github.com/hajimehoshi/ebiten/v2@latest examples/snake
go run cmd/main.go github.com/hajimehoshi/ebiten/v2@latest examples/blocks
go run cmd/main.go github.com/kettek/ebijam22 cmd/magnet
Just ask please.GlitchMe()
somewhere! (ideally before ebiten.RunGame
).
To disable the patches at runtime, you can please.DontGlitchMe()
.
You can also specify a "mode" to define a different level of glitchness:
please.SetMode(please.None) // Keep the features / function hooks but disable all glitches
please.SetMode(please.Unsafe) // Effects frequency and various factors are "maxed"
In order for this library not to be totally useless, there is a way to fetch a few metrics by doing:
metrics := please.GiveMeSomethingUseful()
metrics.Print()
go run cmd/main.go --mode=unsafe github.com/kettek/ebijam22 cmd/magnet
go run cmd/main.go --mode=unsafe github.com/tinne26/transition
- Despite the attempt at putting some locks here and there, this library is definitely not thread-safe (if you're calling Draw commands from multiple goroutines at the same time).
- Not many fancy effects unfortunately, but some extra could be plugged easily after the package gets cleaned up a bit (jam code)
- Only tested on Windows!