Hello i am really new in phaser maybe one week so please be patient thank you
this.physics.add.overlap(player, enemy, stret, null, this);
function stret(){
this.time.addEvent({
delay: 500,
callback: ()=>{
myhp-=1;
},
loop: true
})
}
Everytime my “player” and my “enemy” overlap i need to lower “myhp” every 500ms. But this code will continuously lower my hp no every 500ms. I doesnt look like by i tried everything. Four hours or maybe more of trying to resolve this simple code…Please help me , thank you very much.