save lifes for the actor

I'm working on a game like Super Mario World, I have many Scenes:

1 - Menu;
1 - Levels choice;
10 - Levels play;

so, what I need?!?

My actor player started the game with 10 lifes, when he dies, cut off 1 life, and, to win more lifes, he needs get on the levels 100 coins, so, how can I save this lifes in the game?

Comments

  • JarrenHJarrenH Member Posts: 206
    Look into either saving attributes, or saving tables.
  • doug_smuppetdoug_smuppet Member Posts: 99
    hmm. You don't know a video tutorial to explain that? because I don't know a lot of this program, I started use in last 3 weeks...
  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    edited March 2013
    @doug_smuppet You would make a universal attribute (the type in the scenes) called "Lives". Then you would set it to 10 and make a rule in your character saying "When 'character' collides with 'enemy' change game.Lives to Game.lives-1" and another rule saying "when game.Lives = 0 change scene to 'GameOver' and set lives to 10". To save the lives you would do a timer saying "every '5' seconds save attribute game.Lives with key of Lives" then make an attribute on a loading screen or intro saying "load attribute key 'Lives' into game.Lives". Make sense? If not then if you want send me your project and I'll do it for you for free. :)
  • doug_smuppetdoug_smuppet Member Posts: 99
    @Utveckla_Games it's exactly that I want, but you saying it's easy, and I trying do that here it's very difficult, because I'm a newbie, I don't have all the files ready, so, I can't send nothing to you.

    let's begin, when you told to create a universal attribute, what kind i need create? boolean, text, intender, real or angle?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You would create a game attribute of type Integer and name it game.Lives. Integers are whole numbers and since your "Lives" will be whole numbers, that is the best choice. You can then follow @Utveckla_Games' suggestions above.

    I strongly recommend that you start with video tutorials instead of with forum questions. You'll find that you understand things a lot better once you've taken the time to learn a bit about how to use Creator.

    The links in my signature will take you to YouTube playlists that provide step-by-step instructions for creating a basic game.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • doug_smuppetdoug_smuppet Member Posts: 99
    trank you @tatiang I'll see the link, watching a video it's better for me.
  • doug_smuppetdoug_smuppet Member Posts: 99
    very, very thank you.. it's perfect, I'll test and then i'll tell you if i got it
  • doug_smuppetdoug_smuppet Member Posts: 99
    @Utveckla_Games worked for me, and tried to use the same logic to make a Counter Coins, when I pick up 100 coins, I win + 1 live. I created the attribute "Coins" for this. when I pick up the coins, adding that the contactor, but when arriving at 100, I not able to add an attribute the Lives. look what I did...

    image

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    @doug_smuppet Glad it worked out for you! :D
  • doug_smuppetdoug_smuppet Member Posts: 99
    edited March 2013
    I just have to thank you... Now, my other problem, how can I make a counter coins? I did, but it's not add with the Lives.

    Do you know a video to explain that?
  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    What do you mean a counter coins? Like an actor that displays how many coins you have? If so then I'll post another link to the same project with a coin counter. If not then please explain what you mean. :)
  • doug_smuppetdoug_smuppet Member Posts: 99
    I don' t know how you call this... but yes... is that.. I already created that display, when the actor pick up one more coin, show on the display, but I would like stop when have 100 coins, and add 1 Live on live's display
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    When attribute game.Coins>=100
    .....Change Attribute game.Lives to game.Lives+1
    .....Change Attribute game.Coins to game.Coins-100

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • doug_smuppetdoug_smuppet Member Posts: 99
    perfect!!! very, very thank you ;)
Sign In or Register to comment.