How do I add multiple points to my scoreboard

0 favourites
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • hello. Newbie here.

    i 'm making a game with questions and answers.One question with 7-8 correct answers. Each correct answer gives specific points. i set text1 "0" when game starts.

    EXAMPLE :

    when answer is correct i use : event -> textbox /compare text "LION" / action -> text1 /set text "10"

    so when you type LION in the textbox you take 10 points in text1.

    Problem is i can't add the points of all answers using this way.It keeps only the points of one answer.

    any help around ?

  • You need a Global Variable to keep track of your score.

    Create a Global Variable and call it Score.

    Global Variable Score = 0

    Now each time they get a correct answer use Add To in the systems command to add it to Score.

    On Correct Answer: Add To Score +10

    Then set the text to the Score variable with no quotation marks

    Set Text1 to Score

  • i will try it but i want to mention that not all answers give +10 score. some give 10 some give 20 etc.

    thanks anyway

  • i will try it but i want to mention that not all answers give +10 score. some give 10 some give 20 etc.

    thanks anyway

    Doesn't matter as long as you add that amount of points to Score it will still keep track of score and that is the way to do it.

  • i created the global variable and used the Add To in correct answer. But how i display the Score in text1 ?

  • I found the Add To in system. But how i display the Score in text1 ?

    Like I said above:

    Set Text1 to Score

    No quotation marks. Score is whatever variable name you are using to keep track of the score.

    It will appear as a number in the text you created.

  • i cant understand what "Set Text1 to Score" means. where i do this ? in event sheet ? in object text1 ?

  • i cant understand what "Set Text1 to Score" means. where i do this ? in event sheet ? in object text1 ?

    From your OP"

    "action -> text1 /set text "10"

    So you have a text on your screen named text1 to hold the score right?

    If not you need to create a text to hold the score.

    Then click on that text in the events and look at the bottome where it says SET TEXT.

    Click on that and it will show two quotation marks. The quotation marks are only used to set the text to words or characters not to a number.

    Delete the quotation marks and use your Score variable instead.

    Set Text to Score

    No quotation marks.

    If you have a very large number you will need to make the text box on the layout large enough to hold that number or it will not show up when you run the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did it but no results. When i type correct answer in textbox it shows 7 points. Then i type again another correct answer for 10 points. But it shows 10 on score. not 17

  • I did it but no results. When i type correct answer in textbox it shows 7 points. Then i type again another correct answer for 10 points. But it shows 10 on score. not 17

    You don't set the text to a number. You add that to the Score variable and set the text to the Score variable.

  • Finally i understant what you mean.Thanks a lot man.you are the best!

  • Finally i understant what you mean.Thanks a lot man.you are the best!

    No problem. Now study how that was done because you will use that over and over in your games.

  • if i type the same correct answer ,the score goes up as many times as i type it. how can i make it stop?

  • if i type the same correct answer ,the score goes up as many times as i type it. how can i make it stop?

    Use a global variable as a trigger to stop any action.

    If they answer a question correct add 1 to that variable so it won't repeat.

    On answered correct: Set AnswerCheck = 2

    AnswerCheck = 1

  • I made a global variable TRIGGER = 0, in correct answer -> Add 1 to TRIGGER

    but where i set the check ?

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