Global variables not resetting

  • Link to .capx file (required!):

    Sorry I am not allowed to post URLs.

    <?xml version="1.0" encoding="utf-8" ?>

    <c2eventsheet>

        <!--All the 'name' attributes are ignored by Construct 2 - they are there for readability only.-->

        <name>Event sheet 1</name>

        <events>

            <variable constant="0" name="GameState" sid="7521205156229392" static="0" type="number">0</variable>

            <event-block sid="1094212286233559">

                <conditions>

                   <condition id="-6" name="Every X seconds" sid="8672071400695614" type="System">

                        <param id="0" name="Interval (seconds)">0.1</param>

                   </condition>

                </conditions>

                <actions>

                   <action id="0" name="Set text" sid="391050798386895" type="GSLabel">

                        <param id="0" name="Text">GameState</param>

                   </action>

                   <action id="-10" name="Add to" sid="535072039476809" type="System">

                        <param id="0" name="Variable">GameState</param>

                        <param id="1" name="Value">0.01</param>

                   </action>

                </actions>

                <sub-events>

                   <event-block sid="9307456107329566">

                        <conditions>

                            <condition id="-14" name="Compare variable" sid="3162937537597319" type="System">

                                <param id="0" name="Variable">GameState</param>

                                <param id="1" name="Comparison">0</param>

                                <param id="2" name="Value">0.99</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-9" name="Set value" sid="9394301353346331" type="System">

                                <param id="0" name="Variable">GameState</param>

                                <param id="1" name="Value">0</param>

                            </action>

                        </actions>

                   </event-block>

                   <event-block sid="3873288991156234">

                        <conditions>

                            <condition id="-14" name="Compare variable" sid="4356824377647981" type="System">

                                <param id="0" name="Variable">GameState</param>

                                <param id="1" name="Comparison">0</param>

                                <param id="2" name="Value">8.99</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-9" name="Set value" sid="8779511192712686" type="System">

                                <param id="0" name="Variable">GameState</param>

                                <param id="1" name="Value">1</param>

                            </action>

                        </actions>

                   </event-block>

                </sub-events>

            </event-block>

            <event-block sid="7905295221304959">

                <conditions>

                   <condition id="-14" name="Compare variable" sid="9745005820004223" type="System">

                        <param id="0" name="Variable">GameState</param>

                        <param id="1" name="Comparison">5</param>

                        <param id="2" name="Value">1</param>

                   </condition>

                   <condition id="-14" name="Compare variable" sid="1670061127912336" type="System">

                        <param id="0" name="Variable">GameState</param>

                        <param id="1" name="Comparison">2</param>

                        <param id="2" name="Value">9</param>

                   </condition>

                </conditions>

                <actions />

                <sub-events>

                   <event-block sid="3968104158910789">

                        <conditions>

                            <condition id="2" name="Key is down" sid="7591880731625967" type="Keyboard">

                                <param id="0" name="Key">87 (W)</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-2" name="Set Y" sid="7715353843709927" type="Player">

                                <param id="0" name="Y">Player.Y - 10</param>

                            </action>

                        </actions>

                   </event-block>

                   <event-block sid="3837625376957534">

                        <conditions>

                            <condition id="2" name="Key is down" sid="5452196093064039" type="Keyboard">

                                <param id="0" name="Key">83 (S)</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-2" name="Set Y" sid="3076533841890728" type="Player">

                                <param id="0" name="Y">Player.Y+10</param>

                            </action>

                        </actions>

                   </event-block>

                   <event-block sid="2997468292805195">

                        <conditions>

                            <condition id="2" name="Key is down" sid="662078149653478" type="Keyboard">

                                <param id="0" name="Key">65 (A)</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-1" name="Set X" sid="5266089924620654" type="Player">

                                <param id="0" name="X">Player.X - 10</param>

                            </action>

                        </actions>

                   </event-block>

                   <event-block sid="6118349416048423">

                        <conditions>

                            <condition id="2" name="Key is down" sid="9997786764950556" type="Keyboard">

                                <param id="0" name="Key">68 (D)</param>

                            </condition>

                        </conditions>

                        <actions>

                            <action id="-1" name="Set X" sid="9526024242421107" type="Player">

                                <param id="0" name="X">Player.X + 10</param>

                            </action>

                        </actions>

                   </event-block>

                </sub-events>

            </event-block>

        </events>

    </c2eventsheet>

    Steps to reproduce:

    1.

    2.

    3.

    Observed result:

    Expected result:

    Browsers affected:

    Chrome: yes/no

    Firefox: yes/no

    Internet Explorer: yes/no

    Operating system & service pack:

    Construct 2 version:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Closing, please follow all the bug report guidelines. Just take off the http or www to post a link, we have to have that restriction to ward off spambots.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)