51 lines
609 B
Odin
51 lines
609 B
Odin
package main
|
|
|
|
import rl "vendor:raylib"
|
|
|
|
|
|
Pad :: struct {
|
|
position: Vec2,
|
|
width: Vec2,
|
|
}
|
|
|
|
Ball :: struct {
|
|
position: Vec2,
|
|
velocity: Vec2,
|
|
radius: f32,
|
|
}
|
|
|
|
Brick :: struct {
|
|
position: Vec2,
|
|
size: Vec2,
|
|
color: rl.Color,
|
|
hits: u8,
|
|
}
|
|
|
|
|
|
Game :: struct {
|
|
using state: GameState,
|
|
lives: u8,
|
|
pad: Pad,
|
|
balls: [dynamic]Ball,
|
|
bricks: [dynamic]Brick,
|
|
}
|
|
|
|
|
|
game_init :: proc() -> Game {
|
|
return Game{
|
|
update = game_update,
|
|
draw = game_draw,
|
|
lives = 3,
|
|
pad = Pad{
|
|
position = {f32(WINDOW_WIDTH / 2), f32(WINDOW_HEIGHT - 40)}
|
|
}
|
|
}
|
|
}
|
|
|
|
game_update :: proc(delta: f32) {
|
|
|
|
}
|
|
|
|
game_draw :: proc() {
|
|
}
|