Nantes Université

Skip to content
Extraits de code Groupes Projets
Valider c9e2c28e rédigé par Pol Lamothe's avatar Pol Lamothe
Parcourir les fichiers

Compatibilitée de l'extension multijoueur avec celle de la Terre ronde

parent ca0eaf57
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!12Ajout du mode multijoueur
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
"FloorKind": 2, "FloorKind": 2,
"FloorFile": "../floor-files/beaupasbeau", "FloorFile": "../floor-files/beaupasbeau",
"RandomGeneration":true, "RandomGeneration":true,
"RandomTileX" : 15, "RandomTileX" : 4,
"RandomTileY" : 15, "RandomTileY" : 4,
"Portal":true, "Portal":true,
"SingleUsagePortal" : false, "SingleUsagePortal" : true,
"CameraBlockEdge" : false, "CameraBlockEdge" : true,
"CameraFluide" : true, "CameraFluide" : true,
"GenerationInfinie" : false, "GenerationInfinie" : false,
"TerreRonde": false, "TerreRonde": true,
"MultiplayerKind":0, "MultiplayerKind":0,
"MultiplayerIP" : "localhost", "MultiplayerIP" : "localhost",
"ServerPort" : "3333", "ServerPort" : "3333",
......
...@@ -31,10 +31,32 @@ func (g *Game) Draw(screen *ebiten.Image) { ...@@ -31,10 +31,32 @@ func (g *Game) Draw(screen *ebiten.Image) {
if configuration.Global.MultiplayerKind == 1 { if configuration.Global.MultiplayerKind == 1 {
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character.XShift, g.Character.YShift) g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character.XShift, g.Character.YShift)
if multiplayer.Conn != nil { if multiplayer.Conn != nil {
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character.XShift, g.Character.YShift) if !configuration.Global.TerreRonde {
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X, g.camera.Y, g.Character.XShift, g.Character.YShift)
} else {
for i := -g.floor.QuadtreeContent.Height * (configuration.Global.NumTileY / g.floor.QuadtreeContent.Height); i <= configuration.Global.NumTileY+g.floor.QuadtreeContent.Height; i += g.floor.QuadtreeContent.Height {
for x := -g.floor.QuadtreeContent.Width * (configuration.Global.NumTileX / g.floor.QuadtreeContent.Width); x <= configuration.Global.NumTileX+g.floor.QuadtreeContent.Width; x += g.floor.QuadtreeContent.Width {
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x-g.floor.QuadtreeContent.Width), g.camera.Y+float64(i-g.floor.QuadtreeContent.Height), g.Character.XShift, g.Character.YShift)
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x-g.floor.QuadtreeContent.Width), g.camera.Y+float64(i), g.Character.XShift, g.Character.YShift)
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x), g.camera.Y+float64(i-g.floor.QuadtreeContent.Height), g.Character.XShift, g.Character.YShift)
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x), g.camera.Y+float64(i), g.Character.XShift, g.Character.YShift)
}
}
}
} }
} else { } else {
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character2.XShift, g.Character2.YShift) if !configuration.Global.TerreRonde {
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character2.XShift, g.Character2.YShift)
} else {
for i := -g.floor.QuadtreeContent.Height * (configuration.Global.NumTileY / g.floor.QuadtreeContent.Height); i <= configuration.Global.NumTileY+g.floor.QuadtreeContent.Height; i += g.floor.QuadtreeContent.Height {
for x := -g.floor.QuadtreeContent.Width * (configuration.Global.NumTileX / g.floor.QuadtreeContent.Width); x <= configuration.Global.NumTileX+g.floor.QuadtreeContent.Width; x += g.floor.QuadtreeContent.Width {
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x-g.floor.QuadtreeContent.Width), g.camera.Y+float64(i-g.floor.QuadtreeContent.Height), g.Character.XShift, g.Character.YShift)
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x-g.floor.QuadtreeContent.Width), g.camera.Y+float64(i), g.Character.XShift, g.Character.YShift)
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x), g.camera.Y+float64(i-g.floor.QuadtreeContent.Height), g.Character.XShift, g.Character.YShift)
g.Character.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, g.camera.X+float64(x), g.camera.Y+float64(i), g.Character.XShift, g.Character.YShift)
}
}
}
g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character2.XShift, g.Character2.YShift) g.Character2.Draw(screen, g.floor.QuadtreeContent.Width, g.floor.QuadtreeContent.Height, (g.camera.X), (g.camera.Y), g.Character2.XShift, g.Character2.YShift)
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter