Ninjump type Counter

motorcycle boymotorcycle boy Member Posts: 429
edited March 2015 in Working with GS (Mac)

I notice in Ninjump that they have the first two digits that seem to be counting 10th of a second or 100th of a second. Has anyone played that game? I'd like to implement a counter system for my own endless scroller. Is there a template for something similar to this? Thanks

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    What would the counter be measuring ?

  • motorcycle boymotorcycle boy Member Posts: 429

    The distance traveled upwards by the character. I just have a game level integer that I change every second to game.score+1. I just wanted a nice fluid display like they use in Ninjump. It reminded me of a stop watch display.

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @dreichelt said:
    I just have a game level integer that I change every second to game.score+1.

    If you are changing a value by 1 every 1 second then you don't really need any additional attributes as game.time is already changing by 1 every 1 second, all you are doing is looking at one attribute (game.time) and seeing when it increments by 1 (each second) and then using this to increment a second attribute (game.score), you are just duplicating game.time.

    It's a little looking at a clock, and every hour you write down the time, and print it out and stick it on the wall next to the clock so everyone can look at the printout and see the time . . . but it's just as easy for people to look at the clock that is already there ! :smile:

    If you want to display 1 point every second it would be Display text floor(game.time)

    If you want to display the score in 100ths of a second it would be Display text roundTo(game.time,2)

  • motorcycle boymotorcycle boy Member Posts: 429

    @Socks said:
    If you want to display 100th/second it would be Display roundTo(game.time,2)

    Ah ok thank you for that. Looks to be very simple to implement thankfully.

  • SocksSocks London, UK.Member Posts: 12,822

    @dreichelt said:
    Ah ok thank you for that. Looks to be very simple to implement thankfully.

    Yep, it's very straightforward.

Sign In or Register to comment.