mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
Add Blank
This commit is contained in:
parent
cf53d6a6d0
commit
fe11e23286
35
example/game/blank/blank.go
Normal file
35
example/game/blank/blank.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package blank
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hajimehoshi/go.ebiten/graphics"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Blank struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func New() *Blank {
|
||||||
|
return &Blank{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) ScreenWidth() int {
|
||||||
|
return 256
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) ScreenHeight() int {
|
||||||
|
return 240
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) Fps() int {
|
||||||
|
return 60
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) Init(tf graphics.TextureFactory) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) Update() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (game *Blank) Draw(g graphics.GraphicsContext, offscreen graphics.Texture) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -18,6 +18,7 @@ package main
|
|||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go.ebiten"
|
"github.com/hajimehoshi/go.ebiten"
|
||||||
|
"github.com/hajimehoshi/go.ebiten/example/game/blank"
|
||||||
"github.com/hajimehoshi/go.ebiten/example/game/monochrome"
|
"github.com/hajimehoshi/go.ebiten/example/game/monochrome"
|
||||||
"github.com/hajimehoshi/go.ebiten/example/game/rects"
|
"github.com/hajimehoshi/go.ebiten/example/game/rects"
|
||||||
"github.com/hajimehoshi/go.ebiten/example/game/rotating"
|
"github.com/hajimehoshi/go.ebiten/example/game/rotating"
|
||||||
@ -90,6 +91,8 @@ func main() {
|
|||||||
|
|
||||||
var gm ebiten.Game
|
var gm ebiten.Game
|
||||||
switch gameName {
|
switch gameName {
|
||||||
|
case "blank":
|
||||||
|
gm = blank.New()
|
||||||
case "monochrome":
|
case "monochrome":
|
||||||
gm = monochrome.New()
|
gm = monochrome.New()
|
||||||
case "rects":
|
case "rects":
|
||||||
|
Loading…
Reference in New Issue
Block a user