Great start to a battle scene been looking forever for a piece of code to build on, will you be making any updates to it such as attacks that take random amounts of HP within a set limit, and occasionally dodge attacks or get critical hits, also when you attack both the hp of the player and monster are decreasing at the same time im trying to figure out a way to make the monster attack after the player attacks so when i add my attack animations they each take a turn and not both go off at once any kind of help with turn based issue would be very apreciated
Thanks in Advance!!
I will do that thank you for the input I was wondering what I should do next.
Awsome Thank you very much for the fast reply, i managed to get the attacks random thanks to your arc4random post i just switched the strength value to caricters.strength = (arc4random()%(20-10))+10; or you could do the same on the attack method itself and switch around the values for different attacks, the random attack worked great but i havent figured out how to make the hp value get down to zero it stops once the last random # is greater then the current HP (i have my win battle scene set to activate once the hp reaches 0, I can only make it work is when i set the strength value back to the original way and set a value that will allways end in 0,
I have fixed it for the next post.
so you have the
Inside the else you can set _monster.curHp =0 and then update the monster labels.
[_labelHp2 setString:[NSString stringWithFormat:@"Monster HP: %d/%d", _monster.curHp, _monster.maxHp]];
[_labelMp2 setString:[NSString stringWithFormat:@"Monster HP: %d/%d", _monster.curHp, _monster.maxHp]];
This looks good, but double spaced code? And a serif font in a programming tutorial? Ew.
Well I fixed the double spacing does it look better.
this is not meant as a post – I just wanted to contact you but didn’t find any mail address….
Are you interested in testing http://www.physicseditor.de or http://texturepacker.com for free?
I can give you a free license for both.
sure my email firstname.lastname@example.org
Your email address will not be published. Required fields are marked *
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>