Quote:
Originally Posted by callimuc
Ah I now get it. You'd need to make a player class (like a health class) to check what the players z value is (inside the onActionLighthurt()) and control any further stuff from there on.
PHP Code:
function onActionLighthurt() {
if (player.z in |-3, 3|) { //players Z value goes from -3 to 3
//same as if (player.z >= -3 && player.z <= 3)
//Do your stuff inside here
player.chat = "'eyy";
}
}
for the triggerAction() you'd only need to do triggeraction(player.x + 1.5 + vecx(player.dir) * 4, player.y + 2 + vecy(player.dir) * 4, "Lighthurt", player.dmg); now
|
Thanks for input!
I have a little side question though. How do I change the player's location on the screen?
For example, if I want the player a little further down the screen instead of centered?
Is this possible?