(Solved) logic from older project not working.

Bugs will be moved here once resolved.

Post » Mon May 06, 2013 4:44 pm

Link to .capx file (required!):

This link is a completely stripped down version of a game I have been working on with simple logic that should work but doesnt. The work around is included but disabled.

http://db.tt/uT2cOlZd

Here is a newly made example with exactly the same logic that works as it should.

http://db.tt/ef4Jcvai


Steps to reproduce:
1. Both of the Cap.x have exactly the same logic but behave differently. I have made sure all of the project settings are the same for each.

Observed result:
I have been working on a game for quite some time now, keeping updated with each release. It seems like my project has just stopped working as it should! I have a work around for it but I am concerned my project has become corrupt.


Expected result:
They will react the same!

If someone else can give this a run to make sure its not something to do with my computer I would appreciate it.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack:
Windows 7 64bit.

Construct 2 version:
R128.2GenkiGenga2013-05-07 00:41:45
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Mon May 06, 2013 5:31 pm

I have just reverted copies of the above files back to r126 and have the same results. Can anyone confirm this bug please? (Its just 1 event).

Not sure what to do at this point. Should I start building the game again in the newer version from scratch? :(GenkiGenga2013-05-06 17:33:46
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Mon May 06, 2013 8:01 pm

I think it's working as intended. I'll try to explain. When you have "Sprite2.number = Sprite.number" it loops through each Sprite2 and each Sprite and compares them.

In your first example it's comparing them like this:
Compare Sprite2(number 3) to Sprite(number 1)
Compare Sprite2(number 2) to Sprite(number 2)
Compare Sprite2(number 1) to Sprite(number 3)

You see it's looping through them both in different orders so only Sprite number 2 matches and it's the only one that moves. If you swap the numbers 1 and 3 on Sprite2 then they will all move.

Probably you want to compare each Sprite2 to every Sprite so you should do something like:
For each Sprite2
For each Sprite
Sprite2.number = Sprite.number
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Tue May 07, 2013 12:40 am

Ahhhh, I see!

Your right, adding a 'For each Sprite' to the mix does to fix it and makes sense now.

Thanks @ramones I owe you one, though its probably about 5 by now :)
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests