Global events / objects?

For questions about using Classic.

Post » Mon Aug 10, 2009 2:20 pm

Can I use global events or objects? Could be useful for making more levels to my game.

And by the way if I create new event sheet it's events do nothing?
EDIT: Oh, I have to include it first :D
B
5
S
2
G
8
Posts: 53
Reputation: 3,222

Post » Mon Aug 10, 2009 2:35 pm

[quote:3n57s3xh]Can I use global events or objects? Could be useful for making more levels to my game[/quote:3n57s3xh]

Both can be useful for your game. Reuse a sprite in different layouts by setting it to global and use global variables to store your score or lifecount for example.

And when you're adding event sheets, you have to include them in an event sheet which is linked to the layout (right click in the event sheet editor, select include event sheet).

Hope that helped.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Mon Aug 10, 2009 2:59 pm

Thanks :)
B
5
S
2
G
8
Posts: 53
Reputation: 3,222

Post » Mon Aug 10, 2009 3:06 pm

Wait. How do I add the same object to the next layout?

EDIT: Copy&paste worked.
B
5
S
2
G
8
Posts: 53
Reputation: 3,222

Post » Mon Aug 10, 2009 3:26 pm

You don't need to set an object global to use it in another layout. I've seen it recommended against doing so for visible objects, somewhere around here, and it's good advice I think.
Global makes the instances of the object exist in all layouts - whether they have been placed in Construct or spawned.
Such as when I accidentally had some arrows set global, when I changed layouts I'd still see them placed at the same X/Y positions, which is definitely not what I intended. :)

Copying and pasting non-global objects to other layouts works fine, though. The same event sheets will work on those, as pasting to another layout doesn't make a brand-new.. um.. clone. They'll have the same object ID (if I'm not all mistaken about how this works).
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Mon Aug 10, 2009 5:22 pm

Global for objects simply means it carries over to the next layout. Probably the best use for it for music, so that the song that's playing in one layout will continue, at the same point in the next.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests