This commit is contained in:
Hajime Hoshi 2016-05-14 00:25:11 +09:00
parent 0083fe5df1
commit fdfc44281f
10 changed files with 14 additions and 14 deletions

View File

@ -23,7 +23,7 @@ import (
const FileNameText = "text.png"
//go:generate go-bindata -nocompress -pkg=assets text.png
//go:generate gofmt -w .
//go:generate gofmt -s -w .
const (
TextImageWidth = 192

View File

@ -143,7 +143,7 @@ type _bintree_t struct {
}
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
"text.png": &_bintree_t{text_png, map[string]*_bintree_t{}},
"text.png": {text_png, map[string]*_bintree_t{}},
}}
// Restore an asset under the given directory

View File

@ -18,4 +18,4 @@ package assets
// Use -ignore as a blacklist instead.
//go:generate go-bindata -nocompress -pkg=assets -ignore=\.md$ images
//go:generate gofmt -w .
//go:generate gofmt -s -w .

View File

@ -197,11 +197,11 @@ type _bintree_t struct {
}
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
"images": &_bintree_t{nil, map[string]*_bintree_t{
"arcadefont.png": &_bintree_t{images_arcadefont_png, map[string]*_bintree_t{}},
"ebiten.png": &_bintree_t{images_ebiten_png, map[string]*_bintree_t{}},
"fiveyears.jpg": &_bintree_t{images_fiveyears_jpg, map[string]*_bintree_t{}},
"gophers.jpg": &_bintree_t{images_gophers_jpg, map[string]*_bintree_t{}},
"images": {nil, map[string]*_bintree_t{
"arcadefont.png": {images_arcadefont_png, map[string]*_bintree_t{}},
"ebiten.png": {images_ebiten_png, map[string]*_bintree_t{}},
"fiveyears.jpg": {images_fiveyears_jpg, map[string]*_bintree_t{}},
"gophers.jpg": {images_gophers_jpg, map[string]*_bintree_t{}},
}},
}}

View File

@ -13,6 +13,6 @@
// limitations under the License.
//go:generate go run keyboard/keyboard/gen.go
//go:generate gofmt -w .
//go:generate gofmt -s -w .
package example

View File

@ -88,7 +88,7 @@ func toBytes(l, r []int16) []byte {
panic("len(l) must equal to len(r)")
}
b := make([]byte, len(l)*4)
for i, _ := range l {
for i := range l {
b[4*i] = byte(l[i])
b[4*i+1] = byte(l[i] >> 8)
b[4*i+2] = byte(r[i])

View File

@ -71,7 +71,7 @@ func toBytes(l, r []int16) []byte {
panic("len(l) must equal to len(r)")
}
b := make([]byte, len(l)*4)
for i, _ := range l {
for i := range l {
b[4*i] = byte(l[i])
b[4*i+1] = byte(l[i] >> 8)
b[4*i+2] = byte(r[i])

View File

@ -142,7 +142,7 @@ func main() {
log.Fatal(err)
}
ebitenImageWidth, ebitenImageHeight = ebitenImage.Size()
for i, _ := range sprites.sprites {
for i := range sprites.sprites {
w, h := ebitenImage.Size()
x, y := rand.Intn(screenWidth-w), rand.Intn(screenHeight-h)
vx, vy := 2*rand.Intn(2)-1, 2*rand.Intn(2)-1

View File

@ -42,7 +42,7 @@ var (
)
func update(screen *ebiten.Image) error {
for key, _ := range keyStates {
for key := range keyStates {
if !ebiten.IsKeyPressed(key) {
keyStates[key] = 0
continue

View File

@ -15,4 +15,4 @@
package ebiten
//go:generate go run genkeys.go
//go:generate gofmt -w .
//go:generate gofmt -s -w .