general question: event-building

For questions about using Classic.

Post » Mon Nov 28, 2011 1:18 pm

When should I choose for inserting all conditions in 1 event-block or inserting them as sub events?

Example:

A>
+ System: Is global variable 'Switch' Less than 1
+ Sprite1: Sprite1 overlaps Sprite2
+ Sprite3: Is on-screen
-> do something

B>
+ System: Is global variable 'Switch' Less than 1
   + Sprite1: Sprite1 overlaps Sprite2
      + Sprite3: Is on-screen
      -> do something


I -think- option B is more useful for 2 reasons:
- if you want to add something, you can add it to a sub event.
- if a certain condition asks for cpu, Construct won't bother if the first condition is not met.

Am I correct?
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Mon Nov 28, 2011 4:04 pm

Yeah, I agree that option B is better. If you do plan on adding more to it though (I know you were just saying that as a hypothetical), I'd personally make my own group for it, have it disabled by default, and enable the group when the global variable "Switch" is less than one. If nothing else it's good for organization.
B
16
S
2
G
1
Posts: 156
Reputation: 2,112

Post » Mon Nov 28, 2011 5:07 pm

[QUOTE=rogerty]
- if a certain condition asks for cpu, Construct won't bother if the first condition is not met.[/QUOTE]

First condition must be always met to run other conditions, so there is no real difference between those two examples, but B seems to be bit better for organizing. As you said, if you want to add something, you can add it to a subevent, and you can collapse the whole block, which is useful sometimes.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests