Object should appear, after replay, whose level unfinished.

feromanferoman Member, PRO Posts: 130
For my game and in each level, one diamond is placed.
This disappears forever in the game once I touch it and the level is completed, the way I want. And it works.

So far, so good.

The problem ......
When I touch the diamond and the level is not completed (that is to say, I pressed pause and replay button), the diamond disappears after replay.
I want to avoid this, because level unfinished, so the diamond is not accounted for in the score.

Requires that the diamond disappears when the level is completed and the diamond is touched
If the level is not complete and diamond is touched, it must appear after replay.

It is complicated for me! so help me, please.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    I would need to see the rules for your diamond and for your pause/replay button(s).

    Are you saying that if the player taps the diamond but then restarts the scene, the diamond should re-appear? Usually this is done with a "Reset scene" actor that is hidden and performs a bunch of tasks, such as spawning the diamond actor, when an attribute such as game.reset is changed from false to true.
  • feromanferoman Member, PRO Posts: 130
    edited December 2012
    In response to Tatiang, the ball hits the diamond
    once the event is completed and the level is completed,
    it takes more than diamond does not appear.
    image
    Uploaded with ImageShack.us

    To be more clear, here are some pictures:

    diamond rules 1, when the ball hits the diamond,
    then attribute "integer" "Diamcolision to 1"
    image
    Uploaded with ImageShack.us

    -------

    diamond rules 2, actor destroyed forever
    whose "boolen click" is created.
    image
    Uploaded with ImageShack.us

    -------
    replay after pause
    Level is not finished!
    the ball touches the diamond, I pause and "replay"
    no diamond is my problem.
    You will see on the videos below, the score remains 1.
    image
    Uploaded with ImageShack.us

    --- video
    Here below 2 Video:

    VIDEO 1, "after pause, I replay"
    diamond does not appear!
    We must solve this problem

    Uploaded with ImageShack.us

    ----
    VIDEO 2, "Level complete after touch diamond"
    this event is correct.
    the number 1 is the score of the diamond.
    this works.

    Uploaded with ImageShack.us

    Is that these images will help you to answer me?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    In your pause rules, after you reset the scene, you are setting game.click to 1 (true) but not setting game.diamondCollision to 0. So as soon as you start the scene again, the diamond actor checks to see if game.click=1 and game.diamondCollision=1 and since both are true, it destroys itself.

    The images and video were very helpful! Just a note that you can view the entire expression by clicking on the text field(s) and then taking a screen shot. You can move the expression editor window that pops up so that is doesn't cover part of the rule (such as the less than symbol or the "To:" text).

    image
  • feromanferoman Member, PRO Posts: 130
    thank you for your explanation, but the image that you tell me, I do not understand too well.
    the attribute "diamcollision" is an "integer".
    The best I can send you the scene for you to edit.
    if you wish, you want to coment that I send? by mail.

    remaining in the wait.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Sure, if you compress your file into a .zip, upload it to a file-sharing service and then send me the link to download it, I can take a look.
  • feromanferoman Member, PRO Posts: 130
    Hi Tatiang,
    I've send a private message stating the link.
    remaining in the wait.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @feroman, I'm on a vacation trip right now and can't work on it, but I'll get back to you in a few days.
  • feromanferoman Member, PRO Posts: 130
    Ok, I took note and wish you a good holiday.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Something is setting game.DiamColision to 1 at the start of the scene reset. If you put an actor on the scene with Log Debugging Statement:game.DiamColision, you'll see what I mean. It starts at 0, but once the scene resets, it changes to 1 before the game is played again.

    I noticed you have two behaviors in your Reset actor that have missing attributes. They are just blank on one side of the expression. Check those and see if that's causing the problem.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2013
    It could also be any of the following actors' rules causing game.DiamColision to change at the wrong time:

    image

    (ignore the "debug" actor as I added that)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2013
    Your Stop the ball actor has a rule set to ALL conditions when it should be ANY conditions. That very well may be the problem.

    image
Sign In or Register to comment.