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 Image
B
164
S
49
G
114
Posts: 7,681
Reputation: 79,561

Post » Sat Dec 31, 2011 3:25 am

What is "OO" Open Office? Ocean Orange?
B
137
S
67
G
17
Posts: 1,766
Reputation: 19,992

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 Image
B
164
S
49
G
114
Posts: 7,681
Reputation: 79,561

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
101
S
24
G
200
Posts: 4,218
Reputation: 115,193

Post » Sat Dec 31, 2011 3:53 am

Well, to me, sprite(index), really is the best way to pick in instances.
Image Image
B
164
S
49
G
114
Posts: 7,681
Reputation: 79,561

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
101
S
24
G
200
Posts: 4,218
Reputation: 115,193

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests