the value of the variable is not updated, even if a collision occurred. I don’t understand how to fix it…
let hungerPlayer = 20;
let textHungerPlayer = hungerPlayer;
this.add.text(40, 28, textHungerPlayer);
this.physics.add.collider(player, hare, function() {
hare.destroy();
hungerPlayer += 50;
});
}