package
0.0.0-20241006082703-11c35b5698cf
Repository: https://github.com/sinisterstuf/cr1ckt.git
Documentation: pkg.go.dev
# Functions
ApplyConfigs overrides default values with a config file if available.
Collides checks whether the Cricket is colliding with a tile.
Impassible checks whether a tile is impassible (true) or passible (false).
LoadImage loads an ebiten.Image given the name of a file in the embedded fs.
NewCricket returns a new Cricket object at the given position.
NewGame populates a default game object with game data.
NewObjectFromImage makes a new game Object with fields calculated from an already loaded image.
NewTileRenderer creates a new Renderer instance.
OverlapsTiles checks for collisions on a given layer This inner function is a workaround because we need to loop through both Tiles and AutoTiles in exactly the same way.
Squishy checks whether a tile is squishy (true) or hard (false).
# Constants
Idle is the animation state when the Cricket is not moving.
Jumping is the animation state on the way up.
JumpPress are the different jump states for controls.
JumpPress are the different jump states for controls.
JumpPress are the different jump states for controls.
JumpPress are the different jump states for controls.
Landing is the animation state on the way down.
LayerAuto is the layer to check for auto-tile collisions.
LayerEntities is the layer to use for entity positions.
LayerTile is the layer to check for tile collisions.
# Variables
BlacknessFactor sets after how many jumps the amount of blackness that's added per jump should be doubled.
DebugMode sets whether to display additional debugging info on the screen during playing the game or not.
MaxPrime is the maximum jump level (after division) you can prime the cricket to jump for, it avoids you jumping off the screen.
MinPrime is the minimum jump level (after division) you can prime the cricket to jump for, it ensures you jump somewhat even just for a short tap.
TilesImpassible is a list of tiles you can't pass through while jumping.
TileSquishy is a list of tiles you should move on top of when you them.
TilesWater is a list of tiles that should behave like water.
VelocityDenominator is by how much to divide the time the jump was primed to get the jump velocity.
VelocityXMultiplier is by how much to multiply the Y velocity to get the velocity for the X axis, it's usually bigger.
# Structs
Cricket is a small, jumping insect, the main character of the game.
EmbedLoader is a TilesetLoader for the embedded FS.
Game represents the main game state.
An Object is something that can be seen and positioned in the game.
RenderedLayer represents an LDtk.Layer that was rendered out to an *ebiten.Image.
TileRenderer is a struct that renders LDtk levels to *ebiten.Images.
# Interfaces
TilesetLoader represents an interface that can be implemented to load a tileset from string, returning an *ebiten.Image.
# Type aliases
Blackness is a map to store where black squares should appear on the camera.
CricketState are the different animation states a Cricket can be in.
WinScreen is the screen that's displayed when you win the game.