[SOLVED] Apply a "force" to a Platform object

Get help using Construct 2

Post » Fri Nov 16, 2012 4:21 pm

Situation:
  • A Platform game
  • Wanted to add a "Knock back" effect when a bullet hits an enemy.
  • Enemies have the Platform behaviour
  • Tried to Set Vector X of enemy to a value to simulate a Knockback effect.
  • However I realised, Vector X seems to be capped by the "Max Speed" value of a Platform behaviour.
  • Am reluctant to simply set X position as it will bypass collision detection, i.e. able to push an enemy to the other side of a wall.

Example project:
http://dl.dropbox.com/u/33370253/UsagiNeko.capx

Shouldn't "Max Speed" only cap the speed attainable via user/simulated control, or is there anything that I'm missing out?

Side question:
Will using physics behaviour mean more intensive processing that would potentially slow down the game in the long run (or is the platform behaviour using the same physics code)?

Thanks for trying to help :)!aruche2012-11-19 02:18:31
B
157
S
114
G
8252
Posts: 42
Reputation: 4,134,739

Post » Sun Nov 18, 2012 10:24 am

Any ideas?
B
157
S
114
G
8252
Posts: 42
Reputation: 4,134,739

Post » Sun Nov 18, 2012 1:01 pm

[code]-> set vector X to knockback
-> set maxSpeed to knockback
-> wait knocbackTime
-> set maxSpeed to defaultMaxSpeed[/code]

that's usually how I do a knockback
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Nov 19, 2012 2:17 am

Thanks Yann! I totally missed the "wait" event. Awesome solution.
B
157
S
114
G
8252
Posts: 42
Reputation: 4,134,739


Return to How do I....?

Who is online

Users browsing this forum: Magistross, Yahoo [Bot], zatyka and 23 guests