[Not a bug]Zombie sprite?

0 favourites
  • 3 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Link to .capx file (required!):

    docs.google.com/file/d/0B20uobjbjbtgeFR0eldEQjN1Y2c/edit

    Steps to reproduce:

    1. Run the capx, press any key

    2. Despite the fact that Sprite2 was destroyed on pressing a key, it will still keep adding "-"s to the textbox (forever, this is not a single cycle thing)

    3. A zombie Sprite2 Object with UID 0 and its "death" instance variable = "" (empty) is the cause of the previous behavior

    Observed result:

    Sprites (or objects more generally) keep entering events even though they were destroyed.

    Expected result:

    Once destroyed sprites should not enter events.

    Browsers affected:

    ALL

    Operating system & service pack:

    Win 7 Enterprise SP1

    Construct 2 version:

    R116

  • There's no zombie sprite. It's just the way else works.

    lse :- Run if the previous event did not run. Note that this condition does not pick any objects: if it follows an event that picks objects, in the Else event all instances revert to picked again.

    If event 2 doesn't run (there are no Sprite2 instances with death = "none") then event 3 will run. Sprite2.UID just returns 0 because there are no Sprite2s.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see, in a more conventional programming language an exception would be raised when checking the condition on nonexistent Sprite2 instances (so we would not even reach the "else" part).

    Thanks! Changing the topic title to "not a bug", hopefully it will get moved somewhere better.

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