Realy OO?

Discussion and feedback on Construct 2

Post » Sat Dec 31, 2011 3:14 am

I guess in theory you could make a behavior, sprite(id).behaviorGetpos.x, or like sprite(iid).bullet.speed
Image ImageImage
B
177
S
50
G
205
Posts: 8,684
Reputation: 127,196

Post » Sat Dec 31, 2011 3:25 am

What is "OO" Open Office? Ocean Orange?
B
168
S
81
G
22
Posts: 1,815
Reputation: 24,857

Post » Sat Dec 31, 2011 3:30 am

Well its really oop, object oriented programing.
Basically you group things together like classes, etc, so that you can mentally visualize things rather than just looking at it like code.
Image ImageImage
B
177
S
50
G
205
Posts: 8,684
Reputation: 127,196

Post » Sat Dec 31, 2011 3:31 am

@newt

I'm thinking about a plugin which get all the creating instance, then save the uid - instance reference. So that I can use expression: picker.GetX(uid) to get the x position of instance.

Because that engine can add a destroy callback in plugin, plugin can remove the instance reference to prevent memory leakage.

But,... engine has no way to add a create callback. So maybe a behavior is better then a plugin. Behavior can have onCreate and onDestroy.
Goodbye
B
114
S
31
G
295
Posts: 4,549
Reputation: 164,608

Post » Sat Dec 31, 2011 3:53 am

Well, to me, sprite(index), really is the best way to pick in instances.
Image ImageImage
B
177
S
50
G
205
Posts: 8,684
Reputation: 127,196

Post » Sat Dec 31, 2011 4:50 am

@newt

You may try this [Behavior"> Shell (get inst's expression from uid)

Sorry, it can only get the expression of instance, not the instance's behavior expression.
I thought the expression processing of C2 engine can only return "number" or "string".
[code]sprite(uid).bullet.speed[/code]
first need to return a instance from [code]sprite(uid)[/code]rexrainbow2011-12-31 04:57:35
Goodbye
B
114
S
31
G
295
Posts: 4,549
Reputation: 164,608

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: olaf73645 and 0 guests