OnKeyPressed descoping globals

Bugs will be moved here once resolved.

Post » Sun Jun 23, 2013 4:11 pm

Link to .capx file (required!):
http://bht.hostingsiteforfree.com/bugs/OnKeyPressedGlobalScope.capx

Steps to reproduce:
1. Press down arrow
2. Press up arrow

Observed result:
Down arrow only rotates red block, not green.
Up arrow rotates green and yellow.

Green block uses global. Red block checks global inside scope of OnKeyPressed. Yellow block uses instance variable on green block.

Expected result:
Green block should always rotate as Variable1 is set to 1 in both cases (OnKeyPressed and KeyIsDown).

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

Operating system & service pack:
Win7 SP1

Construct 2 version:
    132 & 135
ImageImageImage
B
71
S
20
G
190
Posts: 3,534
Reputation: 108,342

Post » Mon Jun 24, 2013 5:49 pm

Closing as not a bug. Triggers do not fire in the order the events are shown in the event sheet. In this case 'On down arrow pressed' fires, then 'Every tick' sets both variables back to 0.
Scirra Founder
B
382
S
223
G
85
Posts: 23,987
Reputation: 189,521


Return to Closed bugs

Who is online

Users browsing this forum: tetuan and 5 guests