Bug in for each loop? r92

Bugs will be moved here once resolved.

Post » Fri Jun 08, 2012 5:46 pm

@Ashley Thanks for taking your time to help me, it really is much appreciated! I completely forgot about the bound to layout behaviour so that helps heaps, but in relation to the .capx, as it is it actually doesn't work correctly. The bug can only be seen when you create a few instances of the object. Load the .capx and then click on the page about 10 times to create some instances. Then wait and watch. Eventually a few of the units will move off screen when they shouldn't. I read through the How Events Work sections carefully and it explains the way that events work in the way that I expected them to (edit: although by bad habit I use the explicit "for each" events on and off). Perhaps it is a bug?

Thanks for your help once again!valkyriegames2012-06-08 17:49:52
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Post » Fri Jun 08, 2012 7:33 pm

When you mirror a sprite it's width becomes negative so you'd want to check
GiverUnit.X - abs(GiverUnit.Width)/2 < 0.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sat Jun 09, 2012 5:42 am

Oh wow that's something I didn't know. Thanks @ramones that's really helpful. That solves the mystery! I guess I didn't know all the underlying implementation details. Thanks for that! It wasn't a bug after all. Cheers!
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Previous

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests