Page 2 of 2

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Fri Sep 13, 2013 8:49 am
by skydereign
You need to understand the difference between setting variables and comparing them.
Code: Select all
punching = 1; // this sets punching equal to 1, because there is only one =
punching==1; // this does not set punching to 1, it checks if it is equal to 1, because there are two =

== is used to compare values, so it doesn't change them, while = is used to change variables.
Which means you aren't actually setting punching to 1 in your keydown z event. You need to change the first line to this instead.
Code: Select all
punching=1;

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Sun Sep 15, 2013 10:32 am
by Turon
Thank you Skyderiegn! :) It seems to be working at the moment! :D
but like I say it may be short lived like to last time it worked. :roll:
But I think this may work better than last time. :wink:
Your tip about = and == signs was very helpful with this in mind I can simplify
Codes in my game! :)

Enemy Changeing Animation Before Death

PostPosted: Fri Sep 27, 2013 9:38 am
by Turon
I am tying to make the enemy change animation to a rotating star. I'm not sure on how to make that with my current system. :?

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Fri Sep 27, 2013 4:40 pm
by skydereign
If you mean change animation during the collision event, you can just specify "Collide Actor" where you would typically use "Event Actor", and set the animation to the proper name of the enemies rotating star animation.

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Tue Oct 01, 2013 3:39 pm
by Turon
How would you make the enemy change animation just before dieing?

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Tue Oct 01, 2013 8:10 pm
by skydereign
Turon wrote:How would you make the enemy change animation just before dieing?

gE questions typically take on the form, "How do you do <> when <>". For your question, it is how do you <change animation for the enemy> right before <it dies>. You already know how to change the enemies animation, so all you need to do is figure out when to do it. When is just before dying? From your game it looks like when it collides with a punching player. Therefore instead of destroying the enemy actor on punch, change its animation to the death animation, and when that animation finishes, have it destroy itself (note: in the animation finish event).

Re: Punching and Hp not so easy huh? (Help Appreciated!)

PostPosted: Fri Oct 04, 2013 4:04 pm
by Turon
Thank you skydereign it works! :D