Documentation
¶
Index ¶
- func Dist(x1, y1, x2, y2 float64) float64
- type BitTexture
- type Game
- func (g *Game) CastRays(screen *ebiten.Image)
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) DrawMap(screen *ebiten.Image)
- func (g *Game) KeyboardHandler()
- func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int)
- func (g *Game) Run()
- func (g *Game) Update() error
- type ImgTexture
- type Map
- type TexInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitTexture ¶
BitTexture is a texture that is defined by a bitmap and a color palette.
func (*BitTexture) At ¶
func (t *BitTexture) At(x, y int) color.Color
At returns the color at the given coordinates.
func (*BitTexture) Height ¶
func (t *BitTexture) Height() int
Height returns the height of the texture.
type Game ¶
type Game struct { Scale int // Map Scale (how many pixels per tile) *Map // Map // contains filtered or unexported fields }
Game represents the game.
func (*Game) CastRays ¶
func (g *Game) CastRays(screen *ebiten.Image)
CastRays casts rays from the player to the map.
func (*Game) KeyboardHandler ¶
func (g *Game) KeyboardHandler()
type ImgTexture ¶
type ImgTexture struct {
// contains filtered or unexported fields
}
ImgTexture is a texture that is defined by an image.
func NewImgTexture ¶
func NewImgTexture(img image.Image) *ImgTexture
NewImgTexture returns a new texture that is defined by an image.
func (*ImgTexture) At ¶
func (t *ImgTexture) At(x, y int) color.Color
At returns the color at the given coordinates.
func (*ImgTexture) Height ¶
func (t *ImgTexture) Height() int
Height returns the height of the texture.
type TexInterface ¶
type TexInterface interface { Width() int // Width returns the width of the texture. Height() int // Height returns the height of the texture. At(x, y int) color.Color // At returns the color at the given coordinates. }
TexInterface is an interface for textures.
func NewImgTextureFromBytes ¶
func NewImgTextureFromBytes(p []byte) (TexInterface, error)
NewImgTextureFromBytes returns a new texture that is defined by an image.
Click to show internal directories.
Click to hide internal directories.