feat: initial commit with M1-M4 implementation
This commit is contained in:
40
internal/entities/player.go
Normal file
40
internal/entities/player.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package entities
|
||||
|
||||
type Team int
|
||||
|
||||
const (
|
||||
TeamRed Team = iota
|
||||
TeamBlue
|
||||
)
|
||||
|
||||
type Role int
|
||||
|
||||
const (
|
||||
RoleStriker Role = iota
|
||||
RoleDefender
|
||||
RoleGoalie
|
||||
)
|
||||
|
||||
type Player struct {
|
||||
Position Vector2
|
||||
Velocity Vector2
|
||||
Radius float64
|
||||
Team Team
|
||||
Role Role
|
||||
HomePosition Vector2
|
||||
MaxSpeed float64
|
||||
Acceleration float64
|
||||
}
|
||||
|
||||
func NewPlayer(x, y float64, team Team, role Role) *Player {
|
||||
return &Player{
|
||||
Position: Vector2{X: x, Y: y},
|
||||
HomePosition: Vector2{X: x, Y: y},
|
||||
Velocity: Vector2{X: 0, Y: 0},
|
||||
Radius: 15,
|
||||
Team: team,
|
||||
Role: role,
|
||||
MaxSpeed: 3.0,
|
||||
Acceleration: 0.1,
|
||||
}
|
||||
}
|
||||
19
internal/entities/puck.go
Normal file
19
internal/entities/puck.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package entities
|
||||
|
||||
type Vector2 struct {
|
||||
X, Y float64
|
||||
}
|
||||
|
||||
type Puck struct {
|
||||
Position Vector2
|
||||
Velocity Vector2
|
||||
Radius float64
|
||||
}
|
||||
|
||||
func NewPuck(x, y float64) *Puck {
|
||||
return &Puck{
|
||||
Position: Vector2{X: x, Y: y},
|
||||
Velocity: Vector2{X: 0, Y: 0},
|
||||
Radius: 10,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user