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
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Dec 31, 2011 3:25 am

What is "OO" Open Office? Ocean Orange?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

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
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

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
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

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
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

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
97
S
22
G
176
Posts: 4,108
Reputation: 103,019

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests