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

Non-platform specific questions.

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

Postby skydereign » Fri Sep 13, 2013 8:49 am

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;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

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

Postby Turon » Sun Sep 15, 2013 10:32 am

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! :)
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Enemy Changeing Animation Before Death

Postby Turon » Fri Sep 27, 2013 9:38 am

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. :?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

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

Postby skydereign » Fri Sep 27, 2013 4:40 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

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

Postby Turon » Tue Oct 01, 2013 3:39 pm

How would you make the enemy change animation just before dieing?
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

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

Postby skydereign » Tue Oct 01, 2013 8:10 pm

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).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

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

Postby Turon » Fri Oct 04, 2013 4:04 pm

Thank you skydereign it works! :D
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest