Trigger movement by checking distance.

For questions about using Classic.

Post » Fri Jan 20, 2012 9:29 pm

Hey All,

I am working on a vert. scroller where the character floats up through the sky. I have strewn clouds all throughout the level, but by the time the character floats up to the higher clouds their bullet behaviours have caused them to move out of their correct positions.

I have tried setting events that only enable the bullet behavior if the character is within a certain distance of the cloud...but I can't seem to get it to work correctly. I think it's an error with "Picking" the right clouds to enable??

I've been having the same problem with destroying clouds that are below the character (for the sake of sys. resources)

here's a CAP package

I hope that makes sense...if anybody has an idea, that'd be great.
Thanks yinz.the_chosen_byte2012-01-20 21:30:36
Posts: 91
Reputation: 3,929

Post » Sat Jan 21, 2012 3:39 am

You could just cycle the clouds around the screen chap. Something like this.

For each cloud-
        cloud.x is greater than ScrollXRight + 500 Set position to ScrollXLeft - 500

This will place the clouds back to the left side of the screen once they have left the right side. The extra 500 is to have the cloud off the screen before it changes position.
Posts: 346
Reputation: 2,726

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests