diff --git a/example/blocks/field.go b/example/blocks/field.go index ae24d7843..b52bd2f48 100644 --- a/example/blocks/field.go +++ b/example/blocks/field.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" diff --git a/example/blocks/font.go b/example/blocks/font.go index e9482719c..47764ba34 100644 --- a/example/blocks/font.go +++ b/example/blocks/font.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" @@ -7,7 +7,7 @@ import ( ) func init() { - texturePaths["font"] = "images/blocks/font.png" + texturePaths["font"] = "../images/blocks/font.png" } const charWidth = 8 diff --git a/example/blocks/game.go b/example/blocks/game.go index 317f11081..e63a42c11 100644 --- a/example/blocks/game.go +++ b/example/blocks/game.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" diff --git a/example/blocks/gamescene.go b/example/blocks/gamescene.go index 74ac911f4..fc2dbd6d3 100644 --- a/example/blocks/gamescene.go +++ b/example/blocks/gamescene.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" @@ -10,7 +10,7 @@ import ( ) func init() { - texturePaths["empty"] = "images/blocks/empty.png" + texturePaths["empty"] = "../images/blocks/empty.png" } type GameScene struct { diff --git a/example/blocks/input.go b/example/blocks/input.go index 4334a95da..9c1ad58e5 100644 --- a/example/blocks/input.go +++ b/example/blocks/input.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/input" diff --git a/example/main.go b/example/blocks/main.go similarity index 73% rename from example/main.go rename to example/blocks/main.go index de4360de8..eaee61abe 100644 --- a/example/main.go +++ b/example/blocks/main.go @@ -2,7 +2,6 @@ package main import ( "flag" - "github.com/hajimehoshi/ebiten/example/blocks" "github.com/hajimehoshi/ebiten/ui" "github.com/hajimehoshi/ebiten/ui/glfw" "log" @@ -29,8 +28,8 @@ func main() { } u := new(glfw.UI) - game := blocks.NewGame() - if err := ui.Run(u, game, blocks.ScreenWidth, blocks.ScreenHeight, 2, "Ebiten Demo", 60); err != nil { + game := NewGame() + if err := ui.Run(u, game, ScreenWidth, ScreenHeight, 2, "Ebiten Demo", 60); err != nil { log.Fatal(err) } } diff --git a/example/blocks/piece.go b/example/blocks/piece.go index 9c115b7e8..f0685dad8 100644 --- a/example/blocks/piece.go +++ b/example/blocks/piece.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" @@ -6,7 +6,7 @@ import ( ) func init() { - texturePaths["blocks"] = "images/blocks/blocks.png" + texturePaths["blocks"] = "../images/blocks/blocks.png" } type Angle int diff --git a/example/blocks/scenemanager.go b/example/blocks/scenemanager.go index d6a11feba..01a841b98 100644 --- a/example/blocks/scenemanager.go +++ b/example/blocks/scenemanager.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" diff --git a/example/blocks/textures.go b/example/blocks/textures.go index a33f122e9..519eb4874 100644 --- a/example/blocks/textures.go +++ b/example/blocks/textures.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" diff --git a/example/blocks/titlescene.go b/example/blocks/titlescene.go index 9bbf54aa1..f4e48d10e 100644 --- a/example/blocks/titlescene.go +++ b/example/blocks/titlescene.go @@ -1,4 +1,4 @@ -package blocks +package main import ( "github.com/hajimehoshi/ebiten/graphics" @@ -8,7 +8,7 @@ import ( ) func init() { - texturePaths["background"] = "images/blocks/background.png" + texturePaths["background"] = "../images/blocks/background.png" } type TitleScene struct { diff --git a/readme.md b/readme.md index e89099f8c..265c6af9f 100644 --- a/readme.md +++ b/readme.md @@ -22,15 +22,15 @@ changed easily. ## How to execute the example ``` -:; cd $GOHOME/src/github.com/hajimehoshi/ebiten/example -:; go run main.go +:; cd $GOHOME/src/github.com/hajimehoshi/ebiten/example/blocks +:; go run *.go ``` ### How to benchmark the example ``` -:; cd $GOHOME/src/github.com/hajimehoshi/ebiten/example -:; go build -o=example main.go +:; cd $GOHOME/src/github.com/hajimehoshi/ebiten/example/blocks +:; go build -o=example *.go :; ./example -cpuprofile=cpu.out :; go tool pprof ./example cpu.out ```