Move main.go; Change the package name blocks -> main

This commit is contained in:
Hajime Hoshi 2014-12-08 23:14:20 +09:00
parent 5fc5acd3d9
commit 0d78f9937f
11 changed files with 19 additions and 20 deletions

View File

@ -1,4 +1,4 @@
package blocks
package main
import (
"github.com/hajimehoshi/ebiten/graphics"

View File

@ -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

View File

@ -1,4 +1,4 @@
package blocks
package main
import (
"github.com/hajimehoshi/ebiten/graphics"

View File

@ -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 {

View File

@ -1,4 +1,4 @@
package blocks
package main
import (
"github.com/hajimehoshi/ebiten/input"

View File

@ -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)
}
}

View File

@ -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

View File

@ -1,4 +1,4 @@
package blocks
package main
import (
"github.com/hajimehoshi/ebiten/graphics"

View File

@ -1,4 +1,4 @@
package blocks
package main
import (
"github.com/hajimehoshi/ebiten/graphics"

View File

@ -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 {

View File

@ -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
```