How do I spawn and pin items in a chain (kind of like snake)

Just started using Construct 2? Post your questions here

Post » Thu Jul 28, 2016 8:50 am

Message: timoteii can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
So I'm trying to make a game where the player grows every x seconds. I cannot figure out how to spawn the tailpieces directly behind the last one that was spawned, nor do i know how to pin the spawned tail piece to the newest tailpiece. (Pinning it to the main head is ok, but I'd rather have it pinned to the tailpiece next to it.)

Download Link to project: http://www.mediafire.com/download/ rprxlng7axppkd3/ngai.capx
B
6
S
1
Posts: 3
Reputation: 356

Post » Thu Jul 28, 2016 12:58 pm

https://www.scirra.com/tutorials/750/an ... id-example
That is an example that explains IID.. but download the 'IID_example' file in the post and have a look at the events that create the black dots.
Might help!
B
5
Posts: 8
Reputation: 241

Post » Thu Jul 28, 2016 2:07 pm

dewetberg wrote:...IID...


I looked at that and I managed to spawn the snake tails next to the newest snake tails, but I can't seem to PIN the spawned snake tails to the newest snake tails. Is there something I'm missing?
B
6
S
1
Posts: 3
Reputation: 356

Post » Fri Jul 29, 2016 1:39 pm

Okay I figured this out. I ended up spawning a different object on top of the tails (I call it an anchor) and pinning the tails to the anchors by UID. Sort of a weird workaround but it seems fully functional so far.
B
6
S
1
Posts: 3
Reputation: 356

Post » Fri Jul 29, 2016 7:59 pm

You should not rely on UID, instead create a string instance variable - let's say - "instanceName". Give each object an unique value/name. Then pick anyone you want by System -> Pick by comparison.

Image
ImageImage
B
27
S
16
G
68
Posts: 944
Reputation: 38,597


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 4 guests