From 8042188030da951eb1e013bcffdc0a14f8f0fc0f Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 23 Apr 2024 19:15:04 +0100 Subject: add custom font --- TODO | 4 ++-- assets/font.otf | Bin 0 -> 129532 bytes assets/vo/voice10.ogg | Bin 0 -> 61154 bytes assets/vo/voice11.ogg | Bin 0 -> 44177 bytes main.go | 8 +++++--- 5 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 assets/font.otf create mode 100644 assets/vo/voice10.ogg create mode 100644 assets/vo/voice11.ogg diff --git a/TODO b/TODO index 4455d74..424cd6d 100644 --- a/TODO +++ b/TODO @@ -4,11 +4,11 @@ - [x] animatePlayer - [ ] add particles - [ ] subtle screen shake on death -- [ ] add an actual ending +- [?] add an actual ending - [ ] animateExit - [x] add voiceover - [x] add more levels - [x] add more items - [x] add << and || on pause and play - [x] add menu -- [ ] add hints (press e to edit again, r to reverse) +- [x] add hints (press e to edit again, r to reverse) diff --git a/assets/font.otf b/assets/font.otf new file mode 100644 index 0000000..bffaf51 Binary files /dev/null and b/assets/font.otf differ diff --git a/assets/vo/voice10.ogg b/assets/vo/voice10.ogg new file mode 100644 index 0000000..015944b Binary files /dev/null and b/assets/vo/voice10.ogg differ diff --git a/assets/vo/voice11.ogg b/assets/vo/voice11.ogg new file mode 100644 index 0000000..56298d3 Binary files /dev/null and b/assets/vo/voice11.ogg differ diff --git a/main.go b/main.go index c1a8922..31d2310 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,6 @@ import ( "github.com/hajimehoshi/ebiten/v2/inpututil" "github.com/hajimehoshi/ebiten/v2/vector" "github.com/hajimehoshi/ebiten/v2/text/v2" - "github.com/hajimehoshi/ebiten/v2/examples/resources/fonts" "github.com/hajimehoshi/ebiten/v2/audio" "github.com/hajimehoshi/ebiten/v2/audio/wav" "github.com/hajimehoshi/ebiten/v2/audio/vorbis" @@ -53,6 +52,9 @@ const ( ) var ( + //go:embed assets/font.otf + fontOtf_src []byte + //go:embed shaders/none.kage noneShader_src []byte //go:embed shaders/vcr.kage @@ -572,7 +574,7 @@ func (g *Game) DrawTitle(surface *ebiten.Image, alpha float32) { textSize := 30.0 tmp := ebiten.NewImage(screenWidth, screenHeight) - msg := fmt.Sprintf("LEVEL") + msg := fmt.Sprintf("LEVÅÆ") textOp := &text.DrawOptions{} textOp.GeoM.Translate((screenWidth - textSize*5 ) / 2, (screenHeight - textSize) / 3) textOp.ColorScale.ScaleWithColor(color.RGBA{216, 211, 210, 255}) @@ -911,7 +913,7 @@ func (g *Game) LoadAudio() { } func (g *Game) LoadImages() { - s, err := text.NewGoTextFaceSource(bytes.NewReader(fonts.PressStart2P_ttf)) + s, err := text.NewGoTextFaceSource(bytes.NewReader(fontOtf_src)) if err != nil { log.Fatal(err) } -- cgit v1.2.1