Controlling Instances [SOLVED]

Get help using Construct 2

Post » Wed Nov 28, 2012 2:19 pm

I have a sprite called "Attractor" instances of this sprite have been copied a number of times within a scene

I have a sprite called "Bee" again with multiple instances.

I want to give the attractors two states "on" and "off" - every 5 seconds I want the system to pick one attractor at random and to turn it to "on" while turning the others "off"

At the same time, when an Attractor is "On" I want to tell the bees (which are physics objects) to apply force to the "On" Attractos position.

Does this make sense?

I can't figure it out. I don't know how to control different instances of the same object. Especially I don't know how to tell the Bees to move to the different instances of that same object.CrudeMik2012-11-28 20:28:21
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Nov 28, 2012 4:02 pm

its pretty easy

example
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Wed Nov 28, 2012 4:04 pm

Pretty simple:



beeeeees.capx (r110.2)




ah too slow :)ramones2012-11-28 16:06:43
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Nov 28, 2012 4:11 pm

haha yeah thats....pretty obvious.

I've never used 'pick'

Thanks guys :)
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Nov 28, 2012 8:07 pm

Gah I messed up

So there's another complication. The player character, when the player character gets close to an attractor and the attractor is "on" - I need the bees add force towards the player.

I've got distance(playerbase.X,playerbase.Y,attractor.X, attractor.y) to determine the distance but it seems to only apply to one of the attractors.

Any ideas?
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Wed Nov 28, 2012 8:28 pm

Scratch that, figured it out :)

B
39
S
12
G
8
Posts: 580
Reputation: 7,108


Return to How do I....?

Who is online

Users browsing this forum: flemmig, semaso, Skebab, Virpoja, Yahoo [Bot] and 13 guests