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
164
S
49
G
138
Posts: 7,951
Reputation: 91,868

Post » Sat Dec 31, 2011 3:25 am

What is "OO" Open Office? Ocean Orange?
B
141
S
68
G
17
Posts: 1,769
Reputation: 20,224

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
164
S
49
G
138
Posts: 7,951
Reputation: 91,868

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.
B
107
S
25
G
224
Posts: 4,322
Reputation: 127,821

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
164
S
49
G
138
Posts: 7,951
Reputation: 91,868

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
B
107
S
25
G
224
Posts: 4,322
Reputation: 127,821

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: auramatt and 8 guests