Documentation ¶
Index ¶
- Constants
- Variables
- func DeformBlock(block *LevelBlock, side string)
- func GetLevelLayout(levelNumber int) []string
- func IsBaseDestroyed(levelObjects []LevelBlock) bool
- func SetHealth(brick *LevelBlock, health int)
- func UpdateLevelObjects(levelObjects []LevelBlock)
- type Block
- type Image
- type LevelBlock
- type Line
Constants ¶
View Source
const ( ScreenWidth = 1000 ScreenHeight = 1000 )
Variables ¶
View Source
var Blocks []Block
View Source
var LevelObjects []LevelBlock
Functions ¶
func DeformBlock ¶
func DeformBlock(block *LevelBlock, side string)
func GetLevelLayout ¶
func IsBaseDestroyed ¶
func IsBaseDestroyed(levelObjects []LevelBlock) bool
func SetHealth ¶
func SetHealth(brick *LevelBlock, health int)
Update object health after it gets shot
func UpdateLevelObjects ¶
func UpdateLevelObjects(levelObjects []LevelBlock)
Types ¶
type LevelBlock ¶
type LevelBlock struct {
X, Y float64
Width, Height float64
Blocks []Block
Destructible bool
Collidable bool
Base bool
Health int
Border bool
Image Image
}
func AddLevelBlock ¶
func AddLevelBlock(x, y int, blockType string) LevelBlock
func AddLevelBorder ¶
func AddLevelBorder(x, y, w, h int) LevelBlock
func GetLevelObjects ¶
func GetLevelObjects(levelNum int) []LevelBlock
func PlayerBaseLevelBlock ¶
func PlayerBaseLevelBlock() LevelBlock
PlayerBaseLevelBlock returns a LevelBlock instance with player base coordinates
Click to show internal directories.
Click to hide internal directories.