game

package
v0.0.0-...-a41d8bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gamemain

func Gamemain()

Gamemain ... invoke game

Types

type BlkData

type BlkData struct {
	PosX   float64
	PosY   float64
	Killed bool
	Anger  bool

	DiffX float64
	DiffY float64
	// contains filtered or unexported fields
}

func (*BlkData) MoveDiff

func (d *BlkData) MoveDiff() bool

type Game

type Game struct {
	MainControl func(bool, *Game) bool
	UpdateList  []func(bool, *Game) bool // UpdateList ... contains statego controllers

	// drawList
	DrawBgList               []func()
	DrawStageList            []func()
	DrawFeList               []func()
	DrawTermFunc             []func()
	ClrDrawStageListOnUpdate bool

	// ebiten
	Screen *ebiten.Image

	// fade image
	FadeImage *ebiten.Image

	// user
	ScreenWidth  int
	ScreenHeight int
	Count        int
	BgImage      *ebiten.Image

	GophersImage  *ebiten.Image
	GophersImage2 *ebiten.Image
	GophersImage3 *ebiten.Image

	MascotImage  *ebiten.Image
	MascotAImage *ebiten.Image
	EbitenImage  *ebiten.Image

	// Gopher vs Nic
	BlkDataList    []*BlkData
	GopherDataList []*GopherData
	ScoreData0     *ScoreData
	GameOver       bool

	ScoreMul        int
	ScoreBase       int
	ScoreClickCount int
	// contains filtered or unexported fields
}

Game ...

func (*Game) AddDrawBg

func (g *Game) AddDrawBg(df func()) int

AddDrawBg ... Add Draw Function to DrawBgList

func (*Game) AddDrawFe

func (g *Game) AddDrawFe(df func()) int

AddDrawFe ... Add Draw Function to DrawFeList

func (*Game) AddDrawStage

func (g *Game) AddDrawStage(df func()) int

AddDrawStage ... Add Draw Function to DrawStageList

func (*Game) AddUpdate

func (g *Game) AddUpdate(cf func(bool, *Game) bool) int

AddUpdate ...

func (*Game) ClearAll

func (g *Game) ClearAll()

ClearAll ...

func (*Game) ClrDbgTerm

func (g *Game) ClrDbgTerm()

ClrDbgTerm ...

func (*Game) ClrDrawBg

func (g *Game) ClrDrawBg()

ClrDrawBg ...

func (*Game) ClrDrawFe

func (g *Game) ClrDrawFe()

ClrDrawFe ...

func (*Game) ClrDrawStage

func (g *Game) ClrDrawStage()

ClrDrawStage ...

func (*Game) ClrUpdate

func (g *Game) ClrUpdate()

ClrUpdate ...

func (*Game) DoDraw

func (g *Game) DoDraw()

DoDraw ...

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

Draw ...

func (*Game) DrawImage

func (g *Game) DrawImage(image *ebiten.Image, x, y, angle, scale float64)

DrawImage ... simple draw image * screen's origin is upper left

func (*Game) Ebiten32_png

func (g *Game) Ebiten32_png() []byte

func (*Game) EbitenP32_png

func (g *Game) EbitenP32_png() []byte

func (*Game) EbitenT32_png

func (g *Game) EbitenT32_png() []byte

func (*Game) Gophers128_png

func (g *Game) Gophers128_png() []byte

func (*Game) Gophers32_png

func (g *Game) Gophers32_png() []byte

func (*Game) Gophers64_png

func (g *Game) Gophers64_png() []byte

func (*Game) Gophers_jpg

func (g *Game) Gophers_jpg() []byte

Gophers_jpg ...

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

Layout ...

func (*Game) Mascot16_png

func (g *Game) Mascot16_png() []byte

Mascot16_png ...

func (*Game) Mascot32_png

func (g *Game) Mascot32_png() []byte

Mascot32_png ...

func (*Game) Mascot64_png

func (g *Game) Mascot64_png() []byte

Mascot64_png ...

func (*Game) MascotA32_png

func (g *Game) MascotA32_png() []byte

func (*Game) PlayUpdate

func (g *Game) PlayUpdate()

PlayUpdate ...

func (*Game) SetDbgTerm

func (g *Game) SetDbgTerm(df func())

SetDbgTerm ...

func (*Game) SetDrawBg

func (g *Game) SetDrawBg(handle int, df func())

SetDrawBg ...

func (Game) SetDrawFe

func (g Game) SetDrawFe(handle int, df func())

SetDrawFe ...

func (*Game) SetDrawStage

func (g *Game) SetDrawStage(handle int, df func())

SetDrawStage ...

func (*Game) TermClear

func (g *Game) TermClear()

TermClear ...

func (*Game) TermPrint

func (g *Game) TermPrint(str string)

TermPrint ...

func (*Game) TimeNowMs

func (g *Game) TimeNowMs() int64

TimeNowMs ...

func (*Game) Update

func (g *Game) Update() error

Update ...

type GopherData

type GopherData struct {
	PosX float64
	PosY float64

	DiffX float64
	DiffY float64

	Killed bool
	// contains filtered or unexported fields
}

func (*GopherData) CalcDirClicked

func (d *GopherData) CalcDirClicked()

func (*GopherData) CalcDirTouched

func (d *GopherData) CalcDirTouched()

func (*GopherData) CheckKill

func (d *GopherData) CheckKill() (bool, bool)

CheckKill ... 1st killed blk 2nd All Killed

func (*GopherData) MoveDiff

func (d *GopherData) MoveDiff() bool

func (*GopherData) Reflect

func (d *GopherData) Reflect()

func (*GopherData) Speedup

func (d *GopherData) Speedup(add float64)

type ScoreData

type ScoreData struct {
	PointList []int
	Score     int
	Msg1      string
	Msg2      string
	// contains filtered or unexported fields
}

func (*ScoreData) Add

func (d *ScoreData) Add(point int)

func (*ScoreData) ToString

func (d *ScoreData) ToString() (string, string)

func (*ScoreData) Update

func (d *ScoreData) Update()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL