actor animated to an attack position to hit the enemy
motionlife
Member Posts: 15
Hello GS members!
I made a game which allows the player to control my main actor to attack the enemy.moreover, when the button is clicked, it is also animated to an attack position to kill the enemy.
as for the enemy, he is moving to the left to collide with my main actor.
Question:
1.) How do I make the enemy die / disappear when my main actor is animated to an attack position to hit the enemy?
2.) How do I make my main actor still? cause when the enemy collides with my main actor, he seems to move to the left and sometimes float in the middle of the scene.
3.) I have enabled wrap x for the enemy but the enemy only appears once. what's the solution to it? I would like the enemy to appear 8 times in the scene.
I appreciate it if anyone can help me. thanks
I made a game which allows the player to control my main actor to attack the enemy.moreover, when the button is clicked, it is also animated to an attack position to kill the enemy.
as for the enemy, he is moving to the left to collide with my main actor.
Question:
1.) How do I make the enemy die / disappear when my main actor is animated to an attack position to hit the enemy?
2.) How do I make my main actor still? cause when the enemy collides with my main actor, he seems to move to the left and sometimes float in the middle of the scene.
3.) I have enabled wrap x for the enemy but the enemy only appears once. what's the solution to it? I would like the enemy to appear 8 times in the scene.
I appreciate it if anyone can help me. thanks
Comments
2) Use a collision rule but don't add a Collide behavior to either actor. Or turn off bounciness on both actors if you need to use a collision rule.
3) Scene wrap just allows moving actors to reappear on the other side. What does that have to do with 8 enemies? Post a screenshot of your spawn and enemy movement rules (and maybe a screenshot of your scene) and we'll go from there.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hello Tatiang
Thank you for your response.
With the regards to the custom animation you mentioned, I couldn't find a tutorial that exactly answers my question. perhaps you know a link to a free template that contains it or any useful links? can you post it here?
I used a collision rule but I did not input any bounciness attribute.
Lastly,
I am attaching some screen shots.
enemy
http://i45.tinypic.com/29c0zrd.jpg
main actor 1
http://i48.tinypic.com/2lx6yc0.jpg
main actor 2
http://i49.tinypic.com/2h2jw9u.jpg
any ideas on how to fix it?
The general idea is that you use a timer to create the animation OR you check the self.Image name for a certain image and base your rule off of that.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the link but I must say, this is just too tedious for a complete beginner like me. lol.
anyway, you mentioned about creating a rule self.Image. I think I just did that with my main actor ( please view the link in the previous comment).
May I know what went wrong? how do I alter some changes in the rule?
The idea is to have a rule that says When attribute self.Image = [some image name] --> [perform some action]. self.Image is any one of the animated frames that you're using.
I haven't actually tried that but someone mentioned it recently so it's worth testing out.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I've decided to try it out and made some modifications.
under the animation of my main actor,
I created a change attribute that sets self.image to main actor attack ( boolean attribute I created under "game") .
I have also made some changes in my enemy.
I created a new rule:
when main actor attack is true,
do
on Timer
after 1 seconds, run to completion
and I have added a spawn actor, a mini explosion that signifies that the enemy is completely destroyed.
I tried to preview the game, but still I did not have the effects I desired, am I missing something?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for your suggestion. I tried it and I happen to get a "0". I assume this means there is something wrong with my attribute or the rule I made for both actor and enemy? Please confirm.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I don't understand.
I just followed this tutorial to debug the game :
Under the animation,I added an ON change attribute. I assume that changing the self.image to "main actor attack" refers to both images in the animation. am I right? also, May I know what are suggestions to improve the code for it to work?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I am absolutely confused too.
anyway, Please check your inbox, I have included the link.