Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Thank you! This is great! :) Just what I was looking for my project.

Question: Is it possible to assign a value so that enemies are not killed during the first hit? I tried assigning a variable in the if hit section but for some reason its not working out for me.

Could this also be used for the (enemy) actors to hit back?

Thanks in advance and thank you for the script.

You would need to make a health variable for every enemy, then instead of hiding the enemy when hitting it you just subtract 1 from the enemies health variable. if the value equals 0 then hide it

Enemies can't attack back at the moment. Some kind of attacking will probably added in the future.

Thanks for the quick reply! :) So that would be on the actor (enemy) not the sword script correct?

I tried to subtract "hit points" from the "if hit" sword script and do that. Hide if health = 0 on the enemy actor. For some reason once the health it zero, health reset back to 249 (or around there).

Much appreciated and thank you for all your work :)

Ok got it! Thank you! :) The HP var needs to be on the scene level. Worked like a charm.

(1 edit)

I am really happy that you like it :D

I had the same problem with my Turn Based Battle System too, after checking for health = 0 I just checked if it is above 230 or some high number because the gameboy cant use negative numbers. Be sure to not set your enemies health to something higher than 230 though. Also make sure that, if the enemy has 1 hp left, the damage is not higher than 25 ( 1 - 25 = 231, if more than 25 the enemy will not be killed but gain a huge amount of health)

Edit: After reading this post I thought I have written it a bit unclear hope you understand me lol

Totally! Thank you. I did exactly that. If HP is > 230, I subtracted the HPvar - HPvar which gives me 0. If zero then it hides the enemy or if the players HP is zero, then it ends the game. Thanks again. Having a blast with this.