Object relative spawn point

Get help using Construct 2

Post » Thu Nov 27, 2014 3:49 pm

Is it possible to have an image point for an object that's dependent on instance variables? I'm trying to create an enemy that spawns an object (a bomb), but i want the object to spawn a relative distance away from the enemy (so the same type of enemy will teleport bombs around the player based on its colour).

I've set the enemy object with its instance variable. In the event sheet I've set the enemy object to spawn the bomb object but i can't see what to set as the Imagepoint. I was hoping to do something like Imagepoint = enemy + enemy.spawnedObjectX but i can't seem to get anything working.

I'm not sure if that's the way to go about it since there seems to be no way to take into account positioning. Can anyone help at all?

Thanks in advance.
B
3
Posts: 5
Reputation: 185

Post » Thu Nov 27, 2014 4:46 pm

,,,,,,,,,,,,,
You do not have the required permissions to view the files attached to this post.
Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827

Post » Fri Nov 28, 2014 11:38 am

Thanks Korbaach. That's kind of what i had, but how is the instance variable determining the spawn object's location? I'd like the spawned object to spawn along the x axis of the enemy but the instance at various distances. So far all instance variables seem to spawn the object at either each of the cardinal points or in the centre.
B
3
Posts: 5
Reputation: 185

Post » Fri Nov 28, 2014 12:11 pm

if something ..set Var_ImagePoint =1...................... enemy will spawn bomb on image point 1
if something2..set Var_ImagePoint =2...................... enemy will spawn bomb on image point 2
if something3..set Var_ImagePoint =3...................... enemy will spawn bomb on image point 3
Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827

Post » Fri Nov 28, 2014 1:43 pm

Ah, didn't realise that Var_ImagePoint directly controlled the Image Points of a sprite. I understand now.

That's perfect. Thank you.
B
3
Posts: 5
Reputation: 185

Post » Fri Nov 28, 2014 2:16 pm

..no problem..
just set image point to Var_ImagePoint...
You do not have the required permissions to view the files attached to this post.
Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827


Return to How do I....?

Who is online

Users browsing this forum: digitalsoapbox, RetrocadeMedia and 1 guest