Since you are dealing with hp, you'll need an hp variable. Now the invincibility part is only handled in the code that would lower the hp, usually a collision event.
player -> Collision with Enemy -> Script Editor
- Code: Select all
if(animindex!=getAnimIndex("invincibility"))
{
hp-=1;
}
Replace invincible with the name of the animation you want to be the invincible frame. An actor's current animation is held via an index variable called animindex. The getAnimIndex function takes an animation name and returns the index equivalent of the animation. So by comparing the two, and saying to trigger the code if they are not equal, then you have exactly what you want (dealing damage when the player is not invincible).
For the text health actor, just have a text actor (give it a font file) and have this code.
hp_disp -> Draw Actor -> Script Editor
- Code: Select all
textNumber=hp;
As for your exporting problems, the most likely case is that your bin directory is messed up. Make sure the directory where your gameEditor file that you run to start gE has another directory in it called bin. If not, you'll need to redownload gE, and try using that.