How to make a simple sprite knockback in 8 dir?

Get help using Construct 2

Post » Tue Jun 12, 2012 1:34 am

I would like to make knockback to enemy when i slash enemy with a sword in 8 direction.

Do you have an idea?Joannesalfa2012-06-12 01:35:05
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Tue Jun 12, 2012 3:05 am

Use custom movement? Or set the position of the enermy everytick..........
B
25
S
5
G
1
Posts: 46
Reputation: 3,347

Post » Tue Jun 12, 2012 3:34 am

You could use the bullet behavior:
+PlayerSword collides with Enemy:
---Enemy:Bullet:Set speed: 400
---Enemy:Bullet:Set angle of motion: angle(player.X,player.Y,self.X,self.Y)
---wait 1/4 seconds
---Enemy:Bullet:Set speed: 0

If the enemies move with some other behavior then stop it's motion, disable it, move with the bullet behavior then re-enable the it after the wait.

You could also use events or Custom movement like yuquanzhou007 suggested, whichever method you prefer.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Jun 12, 2012 4:50 am

[QUOTE=R0J0hound] You could use the bullet behavior:
+PlayerSword collides with Enemy:
---Enemy:Bullet:Set speed: 400
---Enemy:Bullet:Set angle of motion: angle(player.X,player.Y,self.X,self.Y)
---wait 1/4 seconds
---Enemy:Bullet:Set speed: 0

If the enemies move with some other behavior then stop it's motion, disable it, move with the bullet behavior then re-enable the it after the wait.

You could also use events or Custom movement like yuquanzhou007 suggested, whichever method you prefer.[/QUOTE]

um.............interesting methods,good thinking
B
25
S
5
G
1
Posts: 46
Reputation: 3,347

Post » Tue Jun 12, 2012 5:32 am

[QUOTE=R0J0hound] You could use the bullet behavior:
+PlayerSword collides with Enemy:
---Enemy:Bullet:Set speed: 400
---Enemy:Bullet:Set angle of motion: angle(player.X,player.Y,self.X,self.Y)
---wait 1/4 seconds
---Enemy:Bullet:Set speed: 0

If the enemies move with some other behavior then stop it's motion, disable it, move with the bullet behavior then re-enable the it after the wait.

You could also use events or Custom movement like yuquanzhou007 suggested, whichever method you prefer.[/QUOTE]

This is really better than custom movement, thank you!
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644


Return to How do I....?

Who is online

Users browsing this forum: PixelatedTrip, Yahoo [Bot] and 0 guests