Restart Game??

FreztinoFreztino Member Posts: 30
edited November -1 in Working with GS (Mac)
Hey there!

In my game iConShooter did so you could press "r" to go to first scene and reset score, but the "targets" in the game doesn't come back... So my question is: How can i get them to respawn??

Please anwser if u got a solution.

From Freztino =)

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    This seems to be a similar problem to the one I'm having which you kindly replied to.

    I imagine it might have something to do with how global variables are re-set. Moving between scenes is handled well, but that's all it seems to do - move you back to a scene.

    I'm not sure how you can re-set stuff to appear 'as it would have been if you were playing the game for the first time'. I think some help from the professionals would be needed. It's probably a very simple solution or there's a bug (it's still in BETA after all).

    On a seperate note, I gave your game a quick go and it was fun for a few minutes - exactly what you need on a mobile phone game ;)

    Cheers,

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Hi Freztino and quantumsheep,
    Thanks for helping each other out. Its good to have the community help on this forum.
    The way scenes are set up, just going back to the scene does not reset everything. For now you would have to respawn all the actors so you can shoot them again.

    How do originally create your targets? If they start somewhere off the scene view, then you would need to create them. The best way right now would be to create an actor that spawns the actors in the right position with some global variable that says restartscene then have your actor spawn everything when you enter the scene and see that the variable is true, then set it to false. Right before you go to the next scene set the global variable to true again so the next scene will respawn.

    Also note that you would need to have scene variable that checks if it has already restarted since you entered the scene so you don't have to see those actors respawn on the same scene just as you were about to leave it.
  • quantumsheepquantumsheep Member Posts: 8,188
    Thanks for the reply, CodeMonkey.

    I'm new to this, so still learning. I fixed my 'reset' problem (http://gamesalad.com/forums/topic.php?id=113) by reseting the variables when you reach the game over screen.

    So the Game Over Scene looks like:

    *Game Score = 0
    *Game Lives = 3

    THEN

    create a rule that takes you back into the game when you press a button.

    As to the problem about re-spawning targets, CodeMonkey asks a pertinent question when he says 'How do you originally create your targets?'

    Personally, I've not had this problem as I started off with the asteroids template. Have a look at that, look at how the enemies are created, then see if you can apply that to your game.

    To make things a little easier, you could try taking the player to a 'Game Over' scene, which could better handle how you restart.

    Hope that helps,

    QS

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • quantumsheepquantumsheep Member Posts: 8,188
    Actually, scrap that about the asteroids game - my enemies are not re-spawning.

    What a palaver!

    Anyway, some help might be found here: http://gamesalad.com/forums/topic.php?id=51

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.