You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
766 B
34 lines
766 B
package types
|
|
|
|
import "image/color"
|
|
|
|
// Block represents a single block in the game
|
|
type Block struct {
|
|
X, Y int
|
|
Type BlockType
|
|
}
|
|
|
|
// BlockType represents different types of tetrominos
|
|
type BlockType int
|
|
|
|
const (
|
|
IBlock BlockType = iota + 1
|
|
JBlock
|
|
LBlock
|
|
OBlock
|
|
SBlock
|
|
TBlock
|
|
ZBlock
|
|
)
|
|
|
|
// Colors for different block types
|
|
var BlockColors = map[BlockType]color.Color{
|
|
0: color.RGBA{0, 0, 0, 0}, // EmptyBlock
|
|
IBlock: color.RGBA{0, 255, 255, 255}, // Cyan
|
|
JBlock: color.RGBA{0, 0, 255, 255}, // Blue
|
|
LBlock: color.RGBA{255, 165, 0, 255}, // Orange
|
|
OBlock: color.RGBA{255, 255, 0, 255}, // Yellow
|
|
SBlock: color.RGBA{0, 255, 0, 255}, // Green
|
|
TBlock: color.RGBA{128, 0, 128, 255}, // Purple
|
|
ZBlock: color.RGBA{255, 0, 0, 255}, // Red
|
|
}
|
|
|