From 457838e26897558dd75c891119a4d51c18c0fff2 Mon Sep 17 00:00:00 2001 From: MrEidam Date: Tue, 4 Jun 2024 20:02:19 +0200 Subject: [PATCH] Transfer to PC --- main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 5f7d0e9..d24d096 100644 --- a/main.js +++ b/main.js @@ -44,6 +44,8 @@ function display(){ }else{ Aimg.src = imgTiger.Dead; } + + if(hp<=0) Aimg.src = imgTiger.Dead; } function play(){ @@ -83,10 +85,13 @@ function clearBoy(){ function time(){ setTimeout (() => { - hunger--; + if(hunger>0) hunger--; clean--; joy--; - age+=0.5; + if(hp>0) age+=0.5; + if(hunger===0) hp--; + + display();