Spawn object on different number of imagepoints

Get help using Construct 2

Post » Mon Dec 09, 2013 12:15 pm

I am making a platformer that would have big blocks which would be randomly generated. These blocks then spawn platforms on their imagepoints, so the locations of the platforms vary from block to block.

Also, the block is a single object; what varies is the frame, so each frame has its imagepoints in a different position.

As long as all the frames have the same number of imagepoints, there's no problem, but I want to make the different frames have a different number of imagepoints and be able to do this.

Here's the example: https://www.dropbox.com/s/wgkup3hwh2dd2su/blockproblem.capx

Let's say I want to have 4 imagepoints(not including the origin) on the third frame. How can I do this?

I suspect the expression ImagePointCount can be helpful here but I don't know how...
B
3
Posts: 11
Reputation: 372

Post » Mon Dec 09, 2013 12:43 pm

repeat block.imagepointcount: block spawn platform on layer 0 imagepoint loopindex+1
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Dec 09, 2013 11:00 pm

Thanks a lot, mindfaQ, but doing that generates some problems...

For some reason, the platforms are not spawned correctly; It's as if it ignores the animation frame. I want the frames to show some different graphics, so the frames need to be right!

Here is an updated version with what mindfaQ suggested:
https://www.dropbox.com/s/wgkup3hwh2dd2su/blockproblem.capx
B
3
Posts: 11
Reputation: 372

Post » Tue Dec 10, 2013 1:40 am

That's because you didn't put the loop in a subevent, so it changes the frame of the block in the loop.

Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786


Return to How do I....?

Who is online

Users browsing this forum: alex3770, Fenix18, Lancifer and 54 guests