Moving different instances

Get help using Construct 2

Post » Tue Nov 08, 2011 6:18 pm

I need help to solve this issue.

I have 6 instances for an object.

I want to move them with a bullet behaviour to different places by clicking whith the mouse to indicate the destination position for each of them.

The instances could be mouving simultaneously to their destinations.

Which is the best way to do it?
B
12
S
2
G
2
Posts: 28
Reputation: 1,695

Post » Tue Nov 08, 2011 6:42 pm

Hmm, you probably want to make some sort of private variable, say a Boolean named "Active" that you set when the object is clicked on and then when the mouse is clicked again you select the object with the "Active" bit set to True and make it move towards where the mouse is. When you click an object you just set the "Active" to false for all objects and again to true for the one that was clicked on.

There may be a more efficient way, but this is what comes to mind.

PS. Forgot to mention - there's currently a critical bug in the latest (r66) C2 that crashes if you work with private variables so if you haven't installed yet you are good to go or, if you have - tough luck.Somebody2011-11-08 18:43:34
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Tue Nov 08, 2011 6:49 pm

I will try that option.

Unfortuantely just installed the new version (uf!!)

Thanks
B
12
S
2
G
2
Posts: 28
Reputation: 1,695

Post » Tue Nov 08, 2011 6:54 pm

made a quick example

http://dl.dropbox.com/u/36224287/bullettarget/bullettarget.capx

http://dl.dropbox.com/u/36224287/bullettarget/index.html

edit: owyeah i made it so when you click it selects the object, then click somewhere else to set the target, you can also multiselect the objectsvtrix2011-11-08 18:57:11
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Wed Nov 09, 2011 1:56 am

That is what I need!! thanks

Unfortunately I can not open the .capx as I am getting a crash when I use the Const2 release 66.

can you send me an image of the Events?

Thanks
B
12
S
2
G
2
Posts: 28
Reputation: 1,695

Post » Wed Nov 09, 2011 9:59 am

vtrix

Thanks for your help, i have installed relase 67 and now I can see the Events you wrote.

Thanks a lot
B
12
S
2
G
2
Posts: 28
Reputation: 1,695


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, badmoodtaylor and 11 guests