Add multi monitor multiplayer
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user