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
92
S
32
G
29
Posts: 3,131
Reputation: 27,918

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
85
S
27
G
85
Posts: 5,073
Reputation: 57,880

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
92
S
32
G
29
Posts: 3,131
Reputation: 27,918


Return to How do I....?

Who is online

Users browsing this forum: blackhornet and 10 guests