This commit is contained in:
bdnugget 2025-01-23 10:09:10 +01:00
parent ef3732c53c
commit a1aeb71512

View File

@ -149,7 +149,7 @@ func (g *Game) DrawMap() {
}
}
func (g *Game) DrawPlayer(player *types.Player, model rl.Model) {
func (g *Game) DrawPlayer(player *types.Player) {
player.Lock()
defer player.Unlock()
@ -169,15 +169,15 @@ func (g *Game) DrawPlayer(player *types.Player, model rl.Model) {
if player.IsMoving && len(modelAsset.Animations.Walk) > 0 {
anim := modelAsset.Animations.Walk[0] // Use first walk animation
player.AnimationFrame = player.AnimationFrame % anim.FrameCount
rl.UpdateModelAnimation(model, anim, player.AnimationFrame)
rl.UpdateModelAnimation(player.Model, anim, player.AnimationFrame)
} else if len(modelAsset.Animations.Idle) > 0 {
anim := modelAsset.Animations.Idle[0] // Use first idle animation
player.AnimationFrame = player.AnimationFrame % anim.FrameCount
rl.UpdateModelAnimation(model, anim, player.AnimationFrame)
rl.UpdateModelAnimation(player.Model, anim, player.AnimationFrame)
}
}
rl.DrawModel(model, playerPos, 16, rl.White)
rl.DrawModel(player.Model, playerPos, 16, rl.White)
// Draw floating messages and path indicators
if player.FloatingMessage != nil {
@ -221,12 +221,12 @@ func (g *Game) Render() {
rl.BeginMode3D(g.Camera)
g.DrawMap()
g.DrawPlayer(g.Player, g.Player.Model)
g.DrawPlayer(g.Player)
for _, other := range g.OtherPlayers {
if other.Model.Meshes == nil {
g.AssignModelToPlayer(other)
}
g.DrawPlayer(other, other.Model)
g.DrawPlayer(other)
}
rl.EndMode3D()