This commit is contained in:
bdnugget 2024-10-11 21:30:29 +02:00
parent c7f7c083b1
commit 4bfb5af362
4 changed files with 210058 additions and 7 deletions

18
main.go
View File

@ -315,11 +315,11 @@ func main() {
go HandleServerCommunication(conn, playerID, &player)
playerModel := rl.LoadModel("resources/models/goonion.obj")
defer rl.UnloadModel(playerModel)
goonerModel := rl.LoadModel("resources/models/goonion.obj")
defer rl.UnloadModel(goonerModel)
playerTexture := rl.LoadTexture("resources/models/goonion.png")
defer rl.UnloadTexture(playerTexture)
rl.SetMaterialTexture(playerModel.Materials, rl.MapDiffuse, playerTexture)
rl.SetMaterialTexture(goonerModel.Materials, rl.MapDiffuse, playerTexture)
coomerModel := rl.LoadModel("resources/models/coomer.obj")
defer rl.UnloadModel(coomerModel)
@ -327,12 +327,19 @@ func main() {
defer rl.UnloadTexture(coomerTexture)
rl.SetMaterialTexture(coomerModel.Materials, rl.MapDiffuse, coomerTexture)
shrekeModel := rl.LoadModel("resources/models/shreke.obj")
defer rl.UnloadModel(shrekeModel)
shrekeTexture := rl.LoadTexture("resources/models/shreke.png")
defer rl.UnloadTexture(shrekeTexture)
rl.SetMaterialTexture(shrekeModel.Materials, rl.MapDiffuse, shrekeTexture)
models := []struct {
Model rl.Model
Texture rl.Texture2D
}{
{Model: playerModel, Texture: playerTexture},
{Model: goonerModel, Texture: playerTexture},
{Model: coomerModel, Texture: coomerTexture},
{Model: shrekeModel, Texture: shrekeTexture},
}
modelIndex := int(playerID) % len(models)
@ -372,15 +379,12 @@ func main() {
DrawMap(mapGrid)
DrawPlayer(player, &player.Model, mapGrid)
// rl.DrawModel(coomerModel, rl.NewVector3(5*TileSize+32, 32, 5*TileSize+32), 16, rl.White)
rl.DrawFPS(10, 10)
rl.EndMode3D()
rl.EndDrawing()
}
}
func ConnectToServer() (net.Conn, int32, error) {
// Attempt to connect to the server
conn, err := net.Dial("tcp", serverAddr)

View 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 shreke.png

210035
resources/models/shreke.obj Normal file

File diff suppressed because it is too large Load Diff

BIN
resources/models/shreke.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB