Log In  

Cart [#56838#] | Code | 2018-09-18 | License: CC4-BY-NC-SA | Embed
4

I put this together for a game I'm working on, but I thought it might be useful to folks as a standalone cart. The code is clearly segregated between the demo and the actual high score code, so should be easy to lift and shift, or feel free to adapt as you like.

To try the demo: left and right increase/decrease the score, up checks the score against the high score table and switches to score entry if your score is high enough.

Features:

  • Large score support (from the discussion here: https://www.lexaloffle.com/bbs/?tid=3577 )
  • "Fancy" High score table display
  • Inline entering of high score name (3 characters to fit in with the 80s/90s game vibe, but could be extended easily enough)
  • Persistence of the save data (uses dget and dset, I know you can store more using alternative methods, but I believe you then lose that data if the cartridge is updated)

Haven't needed to worry too much about token counts yet - its not a huge amount of code as it is, but I might optimise it a bit more in the future, but I don't want to impact the readability.

P#56839 2018-09-18 03:58 ( Edited 2018-09-18 19:22)

:: dw817

This is really good. Can you now make it using the command scoresub(cart_id, table[, score[, extra]]) ?

scoresub is a command available in PICO-8 but i haven't seen anyone making use of it yet.

P#56848 2018-09-18 12:10 ( Edited 2018-09-18 16:10)

What does that do? The (little) info I can find from searching seems to imply it uploads your high scores to the bbs somehow? How do you then view/compare with others?

P#56850 2018-09-18 12:26 ( Edited 2018-09-18 16:26)
:: dw817

I don't know, GrumpyDev ... Don't be grumpy. :)

I just found out about the command myself yesterday. When I read the title of this cart I was hoping it was making use of it.

It may be something ZEP hasn't finished yet.

P#56851 2018-09-18 12:39 ( Edited 2018-09-18 16:39)

Heh, my name just forewarns people of potential grumpyness :P

Yeah, although the command works, it doesn't seem to actually show anywhere, I'm guessing it needs at least a BBS update to show other people's scores.

P#56852 2018-09-18 12:45 ( Edited 2018-09-18 16:45)
:: dw817

Well you've got a cool high-score routine anyways, Grumpydev.

I like the way your cart chooses a vertical quadrant where you enter your name right there on the screen, instead of default at the bottom and after name entry, making it appear at the top.

I might recommend you NOT use TABS in your coding though as if you try to search for something with CTRL+F, unless you are IN that tab, it will NOT show up in a search.

Hopefully ZEP will fix this next release.

P#56854 2018-09-18 12:52 ( Edited 2018-09-18 16:52)

I only added the tab to help split the demo code from the actual high score code, I don't use them in my normal stuff, although I do my actual coding in VSCode anyway :)

P#56855 2018-09-18 12:56 ( Edited 2018-09-18 16:56)
:: zep

scoresub() isn't implemented yet! It was meant as a placeholder for future compatibility, but will be functional from 0.2.0.

P#56856 2018-09-18 14:06 ( Edited 2018-09-18 18:06)
:: dw817

Yay ! Sounds good, ZEP. Was hoping you weren't napping. You're on top of the convos in here so that's good.

P#56858 2018-09-18 15:22 ( Edited 2018-09-18 19:22)

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-09-18 18:13 | 0.019s | 4194k | Q:33