Instances of object

For questions about using Classic.

Post » Wed Mar 19, 2008 10:06 pm

Hello! I'm new here, and at start sorry for my english. ;)

I have two questions about manipulating objects. I used previously Game Maker editor, so:

1) Can i add new type of sprite object, like bullet without putting new one to layer? When i delete all instances of bullet, this type is deleted from whole editor also. That's annoying. :?

2) How can i manipulate bullets from python script? But not all, only one instance? In Game Maker i always write script like this:

[quote:2qdqhb5t]new_object = instance_create( bullet, x, y ); //get unique id of new instance
new_object.x = 10
new_object.y = 40
with ( new_object ) instance_destroy();

//and manipulating all instance of type bullet
bullet.x = 10
bullet.y = 40

Is this possible in Construct actually?
Posts: 1
Reputation: 1,027

Post » Thu Mar 20, 2008 12:45 am

1) Try having just one bullet in the layout, and ticking "Destroy on startup" under Attributes in its properties.

2) Python script is still in early days and I don't think it has per-instance manipulation yet; the primary way of coding games is still via events. Your code is trivially easy with a create action, set X, set Y, destroy, set X, set Y, etc. If you need any help with that, let me know...
Scirra Founder
Posts: 22,821
Reputation: 176,096

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests