Skip to content

Commit

Permalink
Move character to it's own thing
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Jul 13, 2020
1 parent 8ec5132 commit c255f09
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
characters.go
character/yaml.go
sprite_sheet.go
mayhem
*.swp
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,4 +20,4 @@ fmt:

.PHONY: clean
clean:
rm sprite_sheet.go characters.go
rm sprite_sheet.go character/yaml.go
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import (

"math/rand"

"github.com/bobtfish/mayhem/grid"
"github.com/bobtfish/mayhem/logical"
)

func pickColour() pixel.RGBA {
Expand All @@ -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
Expand All @@ -34,7 +32,7 @@ func placeCharactersTest(grid *grid.GameGrid, ct CharacterTypes) {
y++
}
}
}
}*/

/*
func blowSomethingUp(grid *grid.GameGrid) {
Expand Down
4 changes: 2 additions & 2 deletions utils/character_gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit c255f09

Please sign in to comment.