How could do this?

For questions about using Classic.

Post » Fri Jan 29, 2010 11:07 pm

Oops! :oops:

I.. err... the...
Haha, I'm so stupid :lol:

1 question : are simple events like: "if object value is equal to X" as bad as always?
I certainly hope not, as I would have to sift through the 170 events of my no-where-near-finished game engine!
B
2
G
3
Posts: 25
Reputation: 900

Post » Fri Jan 29, 2010 11:35 pm

[quote="Oko":34sys8sk]1 question : are simple events like: "if object value is equal to X" as bad as always?
I certainly hope not[/quote:34sys8sk]

Like I said, you only have to consider time when you are performing time-sensitive things.

If you need to Always check a value, that's fine. If you need to Always update the scrolling to follow a player, that's cool. If you need to Always point at the the mouse, that's cool too.

There's plenty of situations where using Always is a good idea, but if you are dealing with time then it's not a good idea.

If you want to make a timer using Always, then you can do it like so:

[code:34sys8sk]
+ Always
-> Subtract 60*TimeDelta from TimerVariable
[/code:34sys8sk]

If your target FPS is 60 then this will subtract 1 every second from your TimerVariable. TimeDelta is providing a method to measure time in this case.

Or you could do like so:

[code:34sys8sk]
+ Every 1000 MS
-> Subtract 1 from TimerVariable
[/code:34sys8sk]

And it does pretty much the same thing, only in whole numbers instead of floats.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Jan 29, 2010 11:41 pm

[url:3gefzccs]http://apps.sourceforge.net/mediawiki/construct/index.php?title=Time_Delta[/url:3gefzccs]
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat Jan 30, 2010 12:45 am

Yep, I have plenty of time-based events that have just 1 condition such as : "If object value is equal to X"... and that seems to be as bad as "always" :cry:

Oh well, I got some work to do :| .
B
2
G
3
Posts: 25
Reputation: 900

Post » Sat Jan 30, 2010 12:47 am

[quote="Oko":36yd6rrw]Yep, I have plenty of time-based events that have just 1 condition such as : "If object value is equal to X"... and that seems to be as bad as "always" [/quote:36yd6rrw]

Before you go changing stuff, post an example of what you mean, just to be clear.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 01, 2010 10:08 pm

There's no need, I've done what the wiki recommends (switching to unlimited framerate for testing) and I think I've fixed everything.

Using "always" conditions wasn't my main problem, it was conditions on their own which had nothing to do with time, I.E.

Condition: if enemy value is equal to bla bla bla

Is the same as using :

Condition: always

But it's all fixed now, thanks for the help :D .
B
2
G
3
Posts: 25
Reputation: 900

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests