diff --git a/main.go b/main.go index 4fcb812..74e2f49 100644 --- a/main.go +++ b/main.go @@ -50,6 +50,8 @@ type Player struct { TargetPath []Tile Speed float32 ActionQueue []Action // Queue for player actions + Model rl.Model + Texture rl.Texture2D } // Initialize the map with some height data @@ -325,6 +327,18 @@ func main() { defer rl.UnloadTexture(coomerTexture) rl.SetMaterialTexture(coomerModel.Materials, rl.MapDiffuse, coomerTexture) + models := []struct { + Model rl.Model + Texture rl.Texture2D + }{ + {Model: playerModel, Texture: playerTexture}, + {Model: coomerModel, Texture: coomerTexture}, + } + + modelIndex := int(playerID) % len(models) + player.Model = models[modelIndex].Model + player.Texture = models[modelIndex].Texture + rl.SetTargetFPS(60) // Music @@ -356,9 +370,9 @@ func main() { rl.ClearBackground(rl.RayWhite) rl.BeginMode3D(camera) DrawMap(mapGrid) - DrawPlayer(player, &playerModel, mapGrid) + DrawPlayer(player, &player.Model, mapGrid) - rl.DrawModel(coomerModel, rl.NewVector3(5*TileSize+32, 32, 5*TileSize+32), 16, rl.White) + // rl.DrawModel(coomerModel, rl.NewVector3(5*TileSize+32, 32, 5*TileSize+32), 16, rl.White) rl.DrawFPS(10, 10)