Mirror Pinned Image Randomly Stops Working

Get help using Construct 2

Post » Sun Jan 05, 2014 9:07 am

Hi Everyone,

Youtube Video Showing Problem: youtube.com/watch?v=l64Kzou8Rss
CAPX file if needed for review: CAPX

I'm having a problem with mirroring an enemy image. In the attached CAPX you will find that I am using the box technique on both the Player and the Enemies. Right now I am focusing on enemies and simple movement.

When the enemies hit the edge mark, they start to go the opposite way and the image is mirrored. The enemy always goes the opposite way without any issue but the mirroring part seems to break sometimes. In the youtube video you'll see a highlighted/glowing (was using debugger) enemy that seems to not mirror itself until it reaches the middle of the level, but it is supposed to mirror itself immediately after changing directions. Only one is doing that though, the rest are mirroring properly.



I'm honestly stumped on this one because the issue does not happen all the time. To recreate the issue, open the CAPX and preview the game. Create a couple of enemies (press the space bar) and eventually one will break. If one does not break, reload the preview and try again. Try to create the third enemy maybe 5 seconds after the first two.

One thing I did notice, it kind of looks like the broken ones end up mirroring when a specific other enemy hits the edge instead, is it possible that the instances got crossed somehow? It is weird though because the other enemy still mirrors properly itself, and when I check the debugger the IDs are all correct.

Any help on figuring this out is appreciated. I'm sure it is something simple but I'm just not seeing it, especially since it only messes up sometimes instead of all the time.

Enzan
B
13
S
3
G
3
Posts: 35
Reputation: 2,731

Post » Sun Jan 05, 2014 9:17 am

Got It

I knew it was something simple. Just had to move two where the mirroring would occur, which of course is after the enemy hits the edge like I stated earlier

B
13
S
3
G
3
Posts: 35
Reputation: 2,731

Post » Sun Jan 05, 2014 9:18 am

It would probably be a lot easier to use containers for this. Then the enemy-image would automatically be linked to the enemy.

I'm not sure what is going wrong in your current code, but I would put the enemy-image actions in the on created event as subevents (not sure if it would make a difference, but it looks cleaner.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 05, 2014 9:21 am

Ah yes, it's always good practice to look through your eventsheet and see if you are doing stuff every tick that only has to be done once and put it in or under an event triggered once.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jan 05, 2014 10:01 am

Thanks for the advice LittleStain. I'll look into containers.

For now, it works as intended so I am happy
B
13
S
3
G
3
Posts: 35
Reputation: 2,731


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 28 guests