From 61ce682270374298e4093af267aa6034b9eb1e65 Mon Sep 17 00:00:00 2001 From: Natty <31473117+493msi@users.noreply.github.com> Date: Wed, 27 Apr 2022 19:36:14 +0200 Subject: [PATCH] Randomized initial shooting cooldown --- .../java/cz/tefek/srclone/entity/enemy/EntityEnemyScout.java | 3 ++- .../cz/tefek/srclone/entity/enemy/EntityEnemySmallBomber.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemyScout.java b/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemyScout.java index 6e2c0f5..7824329 100644 --- a/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemyScout.java +++ b/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemyScout.java @@ -43,7 +43,8 @@ public class EntityEnemyScout extends EntityEnemy { super.init(game, x, y); this.movementChangeTimer = this.movementChangeInterval; - this.weaponCooldown = this.ammo.getCooldown() * 10.0f; + var rand = this.game.getRandom(); + this.weaponCooldown = this.ammo.getCooldown() * (9.0f + rand.nextFloat() * 3.0f); } @Override diff --git a/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemySmallBomber.java b/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemySmallBomber.java index 9985a3b..61c4571 100644 --- a/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemySmallBomber.java +++ b/engine-demo/jsr-clone/src/main/java/cz/tefek/srclone/entity/enemy/EntityEnemySmallBomber.java @@ -45,8 +45,8 @@ public class EntityEnemySmallBomber extends EntityEnemy { super.init(game, x, y); this.movementChangeTimer = this.movementChangeInterval; - this.weaponCooldown = this.ammo.getCooldown() * 10.0f; - } + var rand = this.game.getRandom(); + this.weaponCooldown = this.ammo.getCooldown() * (9.0f + rand.nextFloat() * 3.0f); } @Override public void tick(float delta)