How do I use delta time as condition for checking collisions

Get help using Construct 2

Post » Sat Dec 13, 2014 11:52 pm

I have a platformer side scroller game that has damage system (player attacking enemies and vice versa), I use "on collision with another object" as condition for attacking.

When my player is hit by enemy, I disable all controls (custom movement, attacks) while showing damage animation.

I have noticed that it works fine, BUT when I don't release my press on my movement keys WHILE player is being hit, the availability of the controls PERSISTS during damage animation of player.

So I have come to the conclusion that I need to check the collision more frequently than I have now.

How do I use delta time as additional condition to add to my already existing events?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Dec 14, 2014 12:00 am

I'm not sure how you've reached this conclusion, or why you think it has something to with delta time -- it just sounds like a bug in your events. If you post a capx -- at the very least show a picture of your events -- it would be a lot easier to help you solve the problem.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,126

Post » Sun Dec 14, 2014 12:16 am

well the last post here explained it to me
viewtopic.php?f=147&t=120636

and this is another situation where I need delta time I think

Bullets have instance var called Bullet_Enabled (text-type), initial value is "No"

When bullets hit player and player is NOT using guard animation
-> disable bullet behavior
->Set Bullet_Enabled to Yes
->Wait 0.5 secs
->Destroy bullet

When bullets hit player and player is using guard animation
-> bounce bullet off player
->Wait 1.5 secs
->Destroy bullet

The significance of the "Yes" value of Bullet is in the damage system of the player, meaning Bullet_Enabled having a value that is not "Yes" will not hurt the enemy (damage player's life, make player use damage animation)

Not all bullets are bounced, and not all bullets that are supposed to damage player does. Both situations are iffy.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Dec 14, 2014 12:19 am

https://www.scirra.com/tutorials/67/del ... dependence

This article shows how to use dt as expression, but I can't figure out which condition to use to be able to include dt in it (condition)
B
16
S
7
Posts: 301
Reputation: 2,726


Return to How do I....?

Who is online

Users browsing this forum: MrQuickGame and 10 guests