Bug with (Animation Frame = 2) and (Trigger Once))

For questions about using Classic.

Post » Sun Jan 03, 2010 4:56 pm

Hey all.
I was testing a little AI, to shot when Distance between the Enemy and the Player.
I have a Counter, i call it to "Time", to add 100 * Timedelta when variable "AI" is equal 1.
When variable "time" => 50, the enemy start to shot and when "time" > 100 time goes to 0.

The problem was:

When the layout have one more Enemy with AI = 1, not all Enemys shot, and i don't know why.
If i put a For Each Object, doesn't work too.

[url:24to64dq]http://dl.dropbox.com/u/881086/Example.cap[/url:24to64dq]


Thanks! :)
B
2
G
4
Posts: 46
Reputation: 1,142

Post » Sun Jan 03, 2010 6:25 pm

use the for each condition.
add the "create object" action to the "sprite value greater then 100" condition
and take out the trigger once condition because it is not needed at all. And that will work.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Mon Jan 04, 2010 2:36 am

Be wary if comparing animation frames: if your game begins to run too slow, an animation frame might be skipped and thus the condition will fail to occur.

You might want to calculate below what framerate this happens and set it as a minimum required framerate for your game (there's a setting for that)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests