score box

0 favourites
  • 6 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • I'm building a simple one level platform jumper for my first game. I have turrets firing at the player and a wall at the end of the map. The player scores one point every time the jump into the wall. One hit from a turret kills the player.

    Anyways I have a array set up to generate 1 point every time player collides with the wall. I don't know how to cause the array's value to be put into the text box.

  • ok so now I have a array called score set up. Everytime player has collision with finish. finish is a block at the end of the map. score gets +1.

    Also have a txt box set up called score. add 1 to score is set up under the same collision command as above. I can see the txt box at the end of the level. But a score is never added to it.

  • added a array to the container property of txt box, still wont display score of game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • have you considered using a global variable instead of an array?

    thats what Im using on "Untitled"

    you set the GV to 0 and everytime the player touches the wall have it add one to the GV. the GV will persist until the game closes or you call a reset on the GV. then you can use a normal text event instead of a textbox and do a replace with something like "Score: " & Player_Score

  • Using a global variable would probably be best here, but if you want to use an array it would be something like this:

    player on collision with finish

    trigger once

    -array set value at 0,0 : array.At(0,0)+1

    system every tick

    text set text : "score: "& array.At(0,0)

  • I went with the global variable. Took me some time to figure out where to declare a global variable at. But the box now add's to the score correctly. Thanks.

    So I take it the array is better used for multiple values. For example player 1 to 4's score and other constant numbers?

    Anywho this puts my first game nearly done. It's sooo bad. But I learned alot of useful stuff. Thanks.

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