mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
examples/flappy: Fullscreen on browsers
This commit is contained in:
parent
2a6672cc8b
commit
b952cb724f
@ -25,6 +25,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/golang/freetype/truetype"
|
"github.com/golang/freetype/truetype"
|
||||||
@ -379,6 +380,11 @@ func (g *Game) drawGopher(screen *ebiten.Image) {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
g := NewGame()
|
g := NewGame()
|
||||||
|
// On browsers, let's use fullscreen so that this is playable on any browsers.
|
||||||
|
// It is planned to ignore the given 'scale' apply fullscreen automatically on browsers (#571).
|
||||||
|
if runtime.GOARCH == "js" {
|
||||||
|
ebiten.SetFullscreen(true)
|
||||||
|
}
|
||||||
if err := ebiten.Run(g.Update, screenWidth, screenHeight, 1, "Flappy Gopher (Ebiten Demo)"); err != nil {
|
if err := ebiten.Run(g.Update, screenWidth, screenHeight, 1, "Flappy Gopher (Ebiten Demo)"); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user