Additional timeout for Kremcoins

This commit is contained in:
Empathic Qubit 2021-03-07 01:21:32 -05:00
parent 58c5fc17d3
commit 89e75273e5

View file

@ -663,6 +663,7 @@ function on_timer()
startKong = game.getKong() startKong = game.getKong()
startBananas = game.getBananas() startBananas = game.getBananas()
startKrem = game.getKremCoins() startKrem = game.getKremCoins()
lastKrem = startKrem
startCoins = game.getCoins() startCoins = game.getCoins()
startLives = game.getLives() startLives = game.getLives()
partyHitCounter = 0 partyHitCounter = 0
@ -861,6 +862,11 @@ function mainLoop (species, genome)
local coins = game.getCoins() - startCoins local coins = game.getCoins() - startCoins
local krem = game.getKremCoins() - startKrem local krem = game.getKremCoins() - startKrem
local kong = game.getKong() local kong = game.getKong()
if krem > lastKrem then
lastKrem = krem
timeout = timeoutConst + 60 * 5
end
print(string.format("Bananas: %d, coins: %d, Krem: %d, KONG: %d", bananas, coins, krem, kong)) print(string.format("Bananas: %d, coins: %d, Krem: %d, KONG: %d", bananas, coins, krem, kong))
@ -868,7 +874,7 @@ function mainLoop (species, genome)
if (bananas + coins) > 0 then if (bananas + coins) > 0 then
print("Bananas, Coins, KONG added " .. bananaCoinsFitness .. " fitness") print("Bananas, Coins, KONG added " .. bananaCoinsFitness .. " fitness")
end end
local hitPenalty = partyHitCounter * 100 local hitPenalty = partyHitCounter * 100
local powerUpBonus = powerUpCounter * 100 local powerUpBonus = powerUpCounter * 100