Documentation ¶
Index ¶
- type Chunk
- type Chunks
- type Coordinates
- type Tile
- type Unit
- type Viewport
- func (v *Viewport) Draw(screen *ebiten.Image, world *World)
- func (v *Viewport) DrawScreenTiles(screen *ebiten.Image, world *World)
- func (v *Viewport) OffsetX() int
- func (v *Viewport) OffsetY() int
- func (v *Viewport) ScreenX() int
- func (v *Viewport) ScreenY() int
- func (v *Viewport) SetOffsetX(offsetX int)
- func (v *Viewport) SetOffsetY(offsetY int)
- func (v *Viewport) SetScreenX(screenX int)
- func (v *Viewport) SetScreenY(screenY int)
- func (v *Viewport) SetWorldPosition(offsetX, offsetY int)
- func (v *Viewport) SetWorldPositionX(worldPositionX int)
- func (v *Viewport) SetWorldPositionY(worldPositionY int)
- func (v *Viewport) Update(offsetX, offsetY int)
- func (v *Viewport) WorldPositionX() int
- func (v *Viewport) WorldPositionY() int
- type World
- func (w *World) ChunkAtMouse() *Chunk
- func (w *World) Draw(screen *ebiten.Image)
- func (w *World) InitWorld(screenX, screenY int)
- func (w *World) MoveOffset(x, y int)
- func (w *World) MoveWorld(direction input.Direction)
- func (w *World) Offset() (x, y int)
- func (w *World) OffsetX() int
- func (w *World) OffsetY() int
- func (w *World) SetOffset(x, y int)
- func (w *World) TileAtMouse() *Tile
- func (w *World) Update()
- func (w *World) WorldPositionAtMouse() (int, int)
- func (w *World) WorldXPositionAtMouse() int
- func (w *World) WorldYPositionAtMouse() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
func (*Chunk) DrawChunkTiles ¶
type Chunks ¶
func (Chunks) Draw ¶
Draw is used to draw all of the chunks on the screen for debugging purposed. Currently this will draw every chunk, not get what is visible in the viewport.
func (Chunks) FindChunkAtPosition ¶
func (Chunks) FindTileAtPosition ¶
type Coordinates ¶
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
func (*Tile) DrawStatus ¶
func (*Tile) SetDrawStatus ¶
type Viewport ¶
type Viewport struct {
// contains filtered or unexported fields
}
Viewport is responsible for drawing everything on the screen.
func (*Viewport) DrawScreenTiles ¶
func (*Viewport) SetOffsetX ¶
func (*Viewport) SetOffsetY ¶
func (*Viewport) SetScreenX ¶
func (*Viewport) SetScreenY ¶
func (*Viewport) SetWorldPosition ¶
func (*Viewport) SetWorldPositionX ¶
func (*Viewport) SetWorldPositionY ¶
func (*Viewport) WorldPositionX ¶
func (*Viewport) WorldPositionY ¶
type World ¶
type World struct {
// contains filtered or unexported fields
}
func (*World) ChunkAtMouse ¶
func (*World) InitWorld ¶
Init World renders all of the chunks of the map when first loading the map. Afterward new chunks will be detected and added in the Update game loop.
We break up rendering into 4 quadrants of the viewport in which the X and Y numbers will always remain positive or negative for simplicity. So far example only things in the top right quadrant of the viewport.
func (*World) MoveOffset ¶
func (*World) TileAtMouse ¶
func (*World) WorldPositionAtMouse ¶
func (*World) WorldXPositionAtMouse ¶
func (*World) WorldYPositionAtMouse ¶
Click to show internal directories.
Click to hide internal directories.