From c255f09282e28a8d8f192b2cdbb4da9cded95f44 Mon Sep 17 00:00:00 2001 From: Tomas Doran Date: Mon, 13 Jul 2020 12:56:13 +0100 Subject: [PATCH] Move character to it's own thing --- .gitignore | 2 +- Makefile | 8 ++++---- character.go => character/character.go | 0 characters.yaml => character/characters.yaml | 0 utils.go | 6 ++---- utils/character_gen/main.go | 4 ++-- 6 files changed, 9 insertions(+), 11 deletions(-) rename character.go => character/character.go (100%) rename characters.yaml => character/characters.yaml (100%) diff --git a/.gitignore b/.gitignore index b0ded1c..0a105e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -characters.go +character/yaml.go sprite_sheet.go mayhem *.swp diff --git a/Makefile b/Makefile index 332c48d..5e2e253 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,10 @@ all: mayhem sprite_sheet.go: sprite_sheet.png utils/sprite_sheet_gen/main.go go run utils/sprite_sheet_gen/main.go > sprite_sheet.go -characters.go: characters.yaml utils/character_gen/main.go - go run utils/character_gen/main.go > characters.go +character/yaml.go: character/characters.yaml utils/character_gen/main.go + go run utils/character_gen/main.go > character/yaml.go -mayhem: sprite_sheet.go characters.go *.go */*.go go.mod go.sum +mayhem: sprite_sheet.go character/yaml.go *.go */*.go go.mod go.sum go build .PHONY: test @@ -20,4 +20,4 @@ fmt: .PHONY: clean clean: - rm sprite_sheet.go characters.go + rm sprite_sheet.go character/yaml.go diff --git a/character.go b/character/character.go similarity index 100% rename from character.go rename to character/character.go diff --git a/characters.yaml b/character/characters.yaml similarity index 100% rename from characters.yaml rename to character/characters.yaml diff --git a/utils.go b/utils.go index bf9ee77..61b43ad 100644 --- a/utils.go +++ b/utils.go @@ -6,8 +6,6 @@ import ( "math/rand" - "github.com/bobtfish/mayhem/grid" - "github.com/bobtfish/mayhem/logical" ) func pickColour() pixel.RGBA { @@ -22,7 +20,7 @@ func drawHydra(ss pixel.Picture, win *pixelgl.Window) { mat = mat.ScaledXY(win.Bounds().Center(), pixel.V(4, 4)) sprite.Draw(win, mat) } - +/* func placeCharactersTest(grid *grid.GameGrid, ct CharacterTypes) { x := 0 y := 0 @@ -34,7 +32,7 @@ func placeCharactersTest(grid *grid.GameGrid, ct CharacterTypes) { y++ } } -} +}*/ /* func blowSomethingUp(grid *grid.GameGrid) { diff --git a/utils/character_gen/main.go b/utils/character_gen/main.go index 96719b2..23d990f 100644 --- a/utils/character_gen/main.go +++ b/utils/character_gen/main.go @@ -8,8 +8,8 @@ import ( const HEREDOC = string('`') func main() { - fmt.Printf("package main\nconst character_yaml = " + HEREDOC) - dat, err := ioutil.ReadFile("characters.yaml") + fmt.Printf("package character\nconst character_yaml = " + HEREDOC) + dat, err := ioutil.ReadFile("character/characters.yaml") if err != nil { panic(err) }