Add multi monitor multiplayer

This commit is contained in:
2024-08-29 18:48:27 +02:00
parent 352c7af7ce
commit 696b827a7d
10 changed files with 1210 additions and 515 deletions
+8 -6
View File
@@ -149,14 +149,16 @@ func (bullet *Bullet) tick(gameMap *GameMap,
}
hitPlayer := false
for _, player := range *players {
if player.rect1.HasIntersection(&bulletRect) ||
player.rect2.HasIntersection(&bulletRect) ||
player.rect3.HasIntersection(&bulletRect) ||
player.rect4.HasIntersection(&bulletRect) {
hitPlayer = true
player.health -= 20
if hitPlayer {
break
}
for _, coloredRect := range player.gameObject.getCurrentRects() {
if coloredRect.rect.HasIntersection(&bulletRect) {
hitPlayer = true
player.shields -= 10
break
}
}
}
if collisionResult != 0 || hitPlayer {
bullet.explode(gameMap, bulletParticleMap)