How can i set a 'hit marker'
rickyniko
Member Posts: 85
hello,
im currently making a platformer game, and i want something similar to supermario,
as in, i want the 'actor two' to die if 'actor one' jumps on its head, but i want 'actor one' to die if actor 2 walks in to actor one.
so basically i want a hit marker on actor two's head,
any ideas?
im currently making a platformer game, and i want something similar to supermario,
as in, i want the 'actor two' to die if 'actor one' jumps on its head, but i want 'actor one' to die if actor 2 walks in to actor one.
so basically i want a hit marker on actor two's head,
any ideas?
Comments
In English, the enemy would say" If I collide with the Player, kill the Player - unless the Player is on top of me. In that case, kill me."
Written out with Rules, it would look like this:
Rule
When all conditions are valid:
Actor overlaps or collides with Actor of type Player
-----Rule
-----When all conditions are valid:
-----game.PlayerY > self.Position.Y
----------[kill me]
-----otherwise
----------[kill Player]
The easiest way would be to create a global boolean attribute called something like 'pleaseKillPlayerNow'.
When the enemy hits the player, change game.pleaseKillPlayerNow to true.
In the Player, have a Rule that listens for that, like this:
Rule
When all conditions are valid:
game.pleaseKillPlayerNow = true
-----Change Attribute: game.pleaseKillPlayerNow to: false
-----Destroy Actor