How to pick a object created in script

For questions about using Classic.

Post » Sun Jul 28, 2013 7:50 am

I create a object in script, and I want to modify some value in the object instance I just create, but I don't know how to do it, could someone tell me what to do? Thanks.

PS: I'm not from a contry which speak English, so please forgive me if I say something wrong. =w=
Posts: 12
Reputation: 679

Post » Sun Aug 04, 2013 12:01 am

Hmm, do you mean in events or in actual Python script? In events it works like this:

[your event conditions ] -> Create object "Sprite1" or whatever it is

Any actions after this will be only applied to the newly created object:


[your event conditions ]
-> Create object "Sprite1"
-> "Sprite1" set private variable "Health" to "100"
-> "Sprite1" set X to "300"
-> "Sprite1" set Y to "200"

This will put the newly created sprite at 300,200 position and give it 100 health private variable (or whatever variables you give it).
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
Posts: 2,201
Reputation: 19,539

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest