Documentation
¶
Index ¶
Constants ¶
View Source
const ( GRAVITY = 0.1 JUMP_POWER = 4 FWD_SPEED = 1 LEFT = -1 RIGHT = 1 TILESIZE = 32 FRAME_WIDTH = TILESIZE FRAME_HEIGTH = TILESIZE )
Constants for physics
Variables ¶
This section is empty.
Functions ¶
func GeDraw ¶
func GeDraw(g *Universe, screen *ebiten.Image)
Ebiten Draw method of GamEngine Draw map.
func Get_img_from_file ¶
return an image from a local file
Types ¶
type Character ¶
type Character struct {
// contains filtered or unexported fields
}
The character represents a live entity.
func NewCharacter ¶
Character entity constructor method
type Sprite ¶
type Sprite struct { // shape Width int Heigth int Parent *Character Frame_offset_x int Frame_offset_y int Static bool // contains filtered or unexported fields }
Sprite objects.
func Draw_map ¶
Convert a matrix of numbers into a nice map. We use this number to find its X and Y on the tilemap file, so we get the right subimages. 0 means blank tile
func (*Sprite) Get_position_onmap ¶
get X, Y position based on map instead of screen
func (*Sprite) Set_dimensions ¶
Set sprite dimensions
type SpriteRect ¶
type SpriteRect struct {
// contains filtered or unexported fields
}
this struct keeps info about the sprite boundaries, so we dont have to calculate it again
type Universe ¶
type Universe struct { Player Character Enemies []Character Projectiles []Sprite Tile_map []Sprite Keys []ebiten.Key // Screen size ScreenWidth int ScreenHeight int // Tile size in pixels TileSize_X int TileSize_Y int // To be used by camera MapOffset_x int MapOffset_y int }
Universe holds everything related to the game
Source Files
¶
Click to show internal directories.
Click to hide internal directories.