diff --git a/.travis.yml b/.travis.yml index 3d0264f94..ebea5bda6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ script: - test -z $(gofmt -s -l $GOPATH/src/github.com/hajimehoshi/ebiten) - go build -tags example -v github.com/hajimehoshi/ebiten/examples/... - go test -v github.com/hajimehoshi/ebiten/... + - go test -tags=example -v github.com/hajimehoshi/ebiten/examples/... - gopherjs build --tags example -v github.com/hajimehoshi/ebiten/examples/blocks # Looks like testing GL on node is hard. diff --git a/examples/2048/2048/tile.go b/examples/2048/2048/tile.go index c4f9b4fe9..2b77f3606 100644 --- a/examples/2048/2048/tile.go +++ b/examples/2048/2048/tile.go @@ -94,6 +94,30 @@ type Tile struct { poppingCount int } +// Pos returns the tile's current position. +// Pos is used only at testing so far. +func (t *Tile) Pos() (int, int) { + return t.current.x, t.current.y +} + +// NextPos returns the tile's next position. +// NextPos is used only at testing so far. +func (t *Tile) NextPos() (int, int) { + return t.next.x, t.next.y +} + +// Value returns the tile's current value. +// Value is used only at testing so far. +func (t *Tile) Value() int { + return t.current.value +} + +// NextValue returns the tile's current value. +// NextValue is used only at testing so far. +func (t *Tile) NextValue() int { + return t.next.value +} + // NewTile creates a new Tile object. func NewTile(value int, x, y int) *Tile { return &Tile{