Add coomer model
This commit is contained in:
parent
d4e299c72b
commit
a9c6298da8
40
main.go
40
main.go
@ -87,6 +87,25 @@ func DrawPlayer(player Player, model *rl.Model, mapGrid [][]Tile) {
|
||||
}
|
||||
// rl.DrawCube(playerPos, 16, 16, 16, rl.Green) // Draw player cube
|
||||
rl.DrawModel(*model, playerPos, 16, rl.White)
|
||||
|
||||
// Draw highlight around target tile
|
||||
if len(player.TargetPath) > 0 {
|
||||
targetTile := player.TargetPath[len(player.TargetPath)-1] // last tile in the slice
|
||||
targetPos := rl.Vector3{
|
||||
X: float32(targetTile.X * TileSize),
|
||||
Y: mapGrid[targetTile.X][targetTile.Y].Height * TileHeight,
|
||||
Z: float32(targetTile.Y * TileSize),
|
||||
}
|
||||
rl.DrawCubeWires(targetPos, TileSize, TileHeight, TileSize, rl.Green)
|
||||
|
||||
nextTile := player.TargetPath[0] // first tile in the slice
|
||||
nextPos := rl.Vector3{
|
||||
X: float32(nextTile.X * TileSize),
|
||||
Y: mapGrid[nextTile.X][nextTile.Y].Height * TileHeight,
|
||||
Z: float32(nextTile.Y * TileSize),
|
||||
}
|
||||
rl.DrawCubeWires(nextPos, TileSize, TileHeight, TileSize, rl.Yellow)
|
||||
}
|
||||
}
|
||||
|
||||
func GetTileAtMouse(mapGrid [][]Tile, camera *rl.Camera3D) (Tile, bool) {
|
||||
@ -214,12 +233,17 @@ func main() {
|
||||
rl.InitAudioDevice()
|
||||
defer rl.CloseAudioDevice()
|
||||
|
||||
model := rl.LoadModel("resources/models/goonion.obj")
|
||||
defer rl.UnloadModel(model)
|
||||
tex := rl.LoadTexture("resources/models/goonion.png")
|
||||
defer rl.UnloadTexture(tex)
|
||||
playerModel := rl.LoadModel("resources/models/goonion.obj")
|
||||
defer rl.UnloadModel(playerModel)
|
||||
playerTexture := rl.LoadTexture("resources/models/goonion.png")
|
||||
defer rl.UnloadTexture(playerTexture)
|
||||
rl.SetMaterialTexture(playerModel.Materials, rl.MapDiffuse, playerTexture)
|
||||
|
||||
rl.SetMaterialTexture(model.Materials, rl.MapDiffuse, tex)
|
||||
coomerModel := rl.LoadModel("resources/models/coomer.obj")
|
||||
defer rl.UnloadModel(coomerModel)
|
||||
coomerTexture := rl.LoadTexture("resources/models/coomer.png")
|
||||
defer rl.UnloadTexture(coomerTexture)
|
||||
rl.SetMaterialTexture(coomerModel.Materials, rl.MapDiffuse, coomerTexture)
|
||||
|
||||
mapGrid := InitMap()
|
||||
|
||||
@ -268,7 +292,11 @@ func main() {
|
||||
rl.ClearBackground(rl.RayWhite)
|
||||
rl.BeginMode3D(camera)
|
||||
DrawMap(mapGrid)
|
||||
DrawPlayer(player, &model, mapGrid)
|
||||
DrawPlayer(player, &playerModel, mapGrid)
|
||||
|
||||
rl.DrawModel(coomerModel, rl.NewVector3(5*TileSize+32, 32, 5*TileSize+32), 16, rl.White)
|
||||
|
||||
rl.DrawFPS(10, 10)
|
||||
|
||||
rl.EndMode3D()
|
||||
rl.EndDrawing()
|
||||
|
12
resources/models/coomer.mtl
Normal file
12
resources/models/coomer.mtl
Normal file
@ -0,0 +1,12 @@
|
||||
# Blender 3.6.0 MTL File: 'None'
|
||||
# www.blender.org
|
||||
|
||||
newmtl Material.001
|
||||
Ns 250.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 2
|
||||
map_Kd coomer.png
|
117248
resources/models/coomer.obj
Normal file
117248
resources/models/coomer.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
resources/models/coomer.png
Normal file
BIN
resources/models/coomer.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 MiB |
Loading…
x
Reference in New Issue
Block a user