dean
New Member
Posts: 5
Posts: 5
|
Post by dean on Jul 20, 2015 4:02:31 GMT
Hi All,
I'm making a PacMan type clone and are stuck on something with killable...
I haev a killable script on both my player and my enemies and that all works fine, plyer runs into enemy and dies, but I am trying to reverse that at runtime. So just like pacman, get the power pill and then you can eat enemies.
I gave a global variable that tells me when they can and can't be killed and that works ok but i'm not sure how to then swap the order around so that when they can die that they actually die when the player hits them.
I am also using BehaviourDesigner so tried to do something as simple as set the enemy hit points to 1 and the player to 10 and then when they are the enemy again, set thier HP to 10 and the player back to 1 but it doesn't seem to work.
Any ideas?
Thanks Dean
|
|
|
Post by DarkTonic Dev on Jul 20, 2015 5:32:31 GMT
Yeah maybe the player should have 0 attack points except when he eats the pill for awhile, so he can't kill anything. That should do it right there. You'd need to script the "pill running out in X seconds" part yourself. As well as the "set attack points to X" for eating a pill.
|
|
dean
New Member
Posts: 5
Posts: 5
|
Post by dean on Jul 20, 2015 6:00:48 GMT
Thanks, that makes sense... i'll give that a try...
Curious though, if both items have attack points of 1 and hit points of 1 how does it make the determination of who dies?
|
|
|
Post by DarkTonic Dev on Jul 21, 2015 4:49:18 GMT
Yeah I think you need to flip flop both actually.
Before eating pill, pacman has 0 attack points and enemies have a positive number of HP. After eating pill, pacman needs to have a positive number of HP and ghosts would have 0 so they don't hurt him.
|
|