Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultHitboxOverlaps(layer GameContext, mine HasHitbox, other []image.Rectangle) (bool, error)
- func GetAmbientLight(time Time) color.Color
- func NewBasicTerrainElement(x int, y int, dx int, dy int) (returnVal image.Rectangle)
- type Berry
- func (b Berry) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (b Berry) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (b Berry) GetTexture() (*ebiten.Image, error)
- func (b Berry) GetZ() (int, error)
- func (b Berry) Origin(GameContext) (image.Point, error)
- func (b Berry) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (b *Berry) SetCooldown(tickOnThisInterval bool)
- func (b Berry) Size(GameContext) (image.Point, error)
- func (b *Berry) Update() error
- type Climbable
- type DepthAwareDrawable
- type Drawable
- type Game
- type GameContext
- type HasHitbox
- type Incline
- func (i *Incline) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (i Incline) GetClimbSpeed() float64
- func (i Incline) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (i Incline) GetZ() (int, error)
- func (i Incline) Origin(GameContext) (image.Point, error)
- func (i Incline) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (i Incline) Size(GameContext) (image.Point, error)
- type InputHandler
- type Lamp
- func (l Lamp) DrawLighting(lightingLayer *ebiten.Image, pos image.Point) error
- func (l Lamp) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (l Lamp) Origin(GameContext) (image.Point, error)
- func (l Lamp) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (l Lamp) Size(GameContext) (image.Point, error)
- type Lightable
- type OffsetImage
- type Player
- func (p Player) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (p Player) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (p Player) GetSmallestJump(jumpables []HasHitbox) (image.Point, bool, error)
- func (p Player) GetZ() (int, error)
- func (p Player) Origin(layer GameContext) (image.Point, error)
- func (p Player) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (p Player) Size(layer GameContext) (image.Point, error)
- func (p *Player) Update() (err error)
- type Renderer
- type River
- func (r River) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (r River) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (r River) GetZ() (int, error)
- func (r River) Origin(layer GameContext) (image.Point, error)
- func (r River) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (r River) Size(layer GameContext) (image.Point, error)
- type Season
- type TextAlignment
- type TextElement
- func (t *TextElement) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (t TextElement) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (t TextElement) Origin(GameContext) (image.Point, error)
- func (t TextElement) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (t TextElement) Size(GameContext) (image.Point, error)
- func (t *TextElement) Update()
- type Time
- func (t Time) Days() int
- func (t Time) DaysThroughYear() int
- func (t Time) Hours() int
- func (t Time) HoursThroughMonth() int
- func (t Time) Months() int
- func (t Time) MonthsThroughYear() int
- func (t Time) String() string
- func (t Time) ThroughDay() float64
- func (t Time) ThroughMonth() float64
- func (t *Time) Tick()
- func (t Time) TicksThroughDay() int
- type Tree
- func (t Tree) DrawAt(screen *ebiten.Image, pos image.Point) error
- func (t Tree) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (t Tree) GetZ() (int, error)
- func (t Tree) Origin(GameContext) (image.Point, error)
- func (t Tree) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (t Tree) Size(GameContext) (image.Point, error)
- type Viewport
- func (v Viewport) DrawToHUD(hudLayer *ebiten.Image, drawable Drawable) error
- func (v Viewport) DrawToLighting(lightingLayer *ebiten.Image, lightable Lightable) error
- func (v Viewport) DrawToMap(mapLayer *ebiten.Image, drawable Drawable) error
- func (v Viewport) GetHitbox(layer GameContext) ([]image.Rectangle, error)
- func (v Viewport) Origin(layer GameContext) (image.Point, error)
- func (v Viewport) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
- func (v Viewport) Size(layer GameContext) (image.Point, error)
- func (v *Viewport) UpdatePosition(player Player) error
Constants ¶
View Source
const ( Light berryVariant = iota Medium Dark )
View Source
const ( WindowWidth = 1920 WindowHeight = 1080 TPS = 60 )
View Source
const ( TPGM = TPS MinsPerHour = 60 HoursPerDay = 20 DaysPerMonth = 10 MonthsPerYear = 8 SolsticeMonthsOffset = 1 )
Variables ¶
View Source
var ( NightAmbientLightColor = color.RGBA{115, 100, 135, 255} DayAmbientLightColor = color.RGBA{255, 255, 255, 255} BackgroundColor = color.RGBA{58, 112, 82, 255} InclineColor = color.RGBA{117, 88, 69, 255} RiverColor = color.RGBA{72, 122, 173, 255} LineartColor = color.RGBA{26, 26, 26, 255} )
Functions ¶
func DefaultHitboxOverlaps ¶ added in v0.0.2
func GetAmbientLight ¶ added in v0.0.3
Types ¶
type Berry ¶ added in v0.1.0
type Berry struct {
// contains filtered or unexported fields
}
func (Berry) GetHitbox ¶ added in v0.1.0
func (b Berry) GetHitbox(layer GameContext) ([]image.Rectangle, error)
func (Berry) GetTexture ¶ added in v0.1.0
func (*Berry) SetCooldown ¶ added in v0.1.0
type DepthAwareDrawable ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (Game) GenerateFrame ¶ added in v0.1.1
type GameContext ¶
type GameContext int
const ( Render GameContext = iota Lighting Collision Interaction )
type HasHitbox ¶
type HasHitbox interface { // Most objects run a direct call to DefaultHitboxOverlaps. // This is basically here incase of non-rectangle hitboxes // like circles Overlaps(GameContext, []image.Rectangle) (bool, error) Origin(GameContext) (image.Point, error) Size(GameContext) (image.Point, error) GetHitbox(GameContext) ([]image.Rectangle, error) }
type Incline ¶
type Incline struct {
// contains filtered or unexported fields
}
func NewIncline ¶ added in v0.1.1
func (Incline) GetClimbSpeed ¶
func (Incline) GetHitbox ¶ added in v0.0.2
func (i Incline) GetHitbox(layer GameContext) ([]image.Rectangle, error)
type InputHandler ¶ added in v0.1.0
type InputHandler struct {
// contains filtered or unexported fields
}
func NewInputHandler ¶ added in v0.1.0
func NewInputHandler() InputHandler
func (InputHandler) ForwardsImpulse ¶ added in v0.1.0
func (p InputHandler) ForwardsImpulse() float64
func (InputHandler) IsClimbing ¶ added in v0.1.0
func (p InputHandler) IsClimbing() bool
func (InputHandler) IsJumping ¶ added in v0.1.0
func (p InputHandler) IsJumping() bool
func (InputHandler) LeftImpulse ¶ added in v0.1.0
func (p InputHandler) LeftImpulse() float64
type Lamp ¶
type Lamp struct {
// contains filtered or unexported fields
}
func (Lamp) DrawLighting ¶
func (Lamp) GetHitbox ¶ added in v0.0.2
func (l Lamp) GetHitbox(layer GameContext) ([]image.Rectangle, error)
type OffsetImage ¶ added in v0.1.1
func ApplyLineart ¶ added in v0.0.2
func ApplyLineart(oldImgSeg *ebiten.Image, fullObj HasHitbox, thisSeg image.Rectangle) (*OffsetImage, error)
Takes an image and adds lineart to all sides of it before returning the new image. The image given should be a single rect out of the full object so that it can be computed seperately. The new offset from the original image is also returned so the image can be seemlessly inserted.(This is useful for keeping it in line with hitboxes)
func (*OffsetImage) DrawAt ¶ added in v0.1.1
func (l *OffsetImage) DrawAt(screen *ebiten.Image, pos image.Point)
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (Player) GetHitbox ¶ added in v0.0.2
func (p Player) GetHitbox(layer GameContext) ([]image.Rectangle, error)
func (Player) GetSmallestJump ¶ added in v0.0.2
func (Player) Origin ¶ added in v0.0.2
func (p Player) Origin(layer GameContext) (image.Point, error)
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
type River ¶
type River struct {
// contains filtered or unexported fields
}
func (River) GetHitbox ¶ added in v0.0.2
func (r River) GetHitbox(layer GameContext) ([]image.Rectangle, error)
type Season ¶ added in v0.0.3
type Season int
type TextAlignment ¶ added in v0.0.3
type TextAlignment int
const ( // Position doesn't get automatically controlled // and needs to be done separately Free TextAlignment = iota // Automatically adjust the position of the text // to be centred at the top of the screen TopCentre )
type TextElement ¶
type TextElement struct { Contents string Alignment TextAlignment Font assets.Font Scale int // contains filtered or unexported fields }
func NewTextElement ¶ added in v0.1.1
func NewTextElement(contents string, alignment TextAlignment, font assets.Font, scale int) TextElement
func (*TextElement) DrawAt ¶
func (t *TextElement) DrawAt(screen *ebiten.Image, pos image.Point) error
func (TextElement) GetHitbox ¶ added in v0.0.2
func (t TextElement) GetHitbox(layer GameContext) ([]image.Rectangle, error)
func (TextElement) Origin ¶ added in v0.0.2
func (t TextElement) Origin(GameContext) (image.Point, error)
func (TextElement) Overlaps ¶ added in v0.0.2
func (t TextElement) Overlaps(layer GameContext, other []image.Rectangle) (bool, error)
func (TextElement) Size ¶ added in v0.0.2
func (t TextElement) Size(GameContext) (image.Point, error)
func (*TextElement) Update ¶ added in v0.0.2
func (t *TextElement) Update()
type Time ¶
type Time int
func (Time) DaysThroughYear ¶ added in v0.1.0
func (Time) HoursThroughMonth ¶ added in v0.1.0
func (Time) MonthsThroughYear ¶ added in v0.1.0
func (Time) ThroughDay ¶ added in v0.1.0
func (Time) ThroughMonth ¶ added in v0.1.0
func (Time) TicksThroughDay ¶ added in v0.1.0
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
func (Tree) GetHitbox ¶ added in v0.0.2
func (t Tree) GetHitbox(layer GameContext) ([]image.Rectangle, error)
type Viewport ¶
type Viewport struct {
// contains filtered or unexported fields
}
func NewViewport ¶
func NewViewport() Viewport
func (Viewport) DrawToLighting ¶
func (Viewport) GetHitbox ¶ added in v0.0.2
func (v Viewport) GetHitbox(layer GameContext) ([]image.Rectangle, error)
func (Viewport) Origin ¶ added in v0.0.2
func (v Viewport) Origin(layer GameContext) (image.Point, error)
func (Viewport) Size ¶ added in v0.0.2
func (v Viewport) Size(layer GameContext) (image.Point, error)
func (*Viewport) UpdatePosition ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.