Log In  


Cart #58080 | 2018-10-18 | Code ▽ | Embed ▽ | No License
4

Picked something simple for my first PICO-8 game. Also first time coding in Lua so the code is probably horrid.

It's basically this. I've only managed 1024 myself and I don't know what happens after 8192 because there's no more sprites after that.

Changes:

  • Using sspr() instead of spr() to draw parts of blocks, so they appear to flow into each other when merging
  • Animation cycle now skips if there's nothing to change, speeding up response time.
  • Added instructions
  • Added game over screen with restart button
  • Added persistent high score (thanks tobiasvl)
  • Quick fix to high score because I'm bad at variable names

To do:

  • Add sounds maybe (how do you make a sliding sound in PICO-8?)
  • Some sort of fanfare when you reach 2048? Fireworks?

I doubt I'll come back to this. It has reached my mental "close enough".

4


Good conversion! My high score was 6948.


Nice! Always a good time-killer.

Persistent local high score is very easy! Put it on your to do list instead of your later list. You really only need to add two lines to your code. One call to 'cartdata("zach_2048")' (or something) in '_init()', and when you get a game over, add something like 'if (score > dget(1)) dset(1, score)'. Boom, persistent.

Of course you probably want to display the high score somewhere too.


Thanks, that actually looks far easier than the docs made it appear. High score can probably go where the direction indicator is. That started as a debug thing that I left in because I liked the arrows. It really serves no purpose.


Great job on your first game. I have never gotten to 2048 before.


Score: 1404.

At first I thought this was an addition kind of game so I avoided it. Now I see its more of an interesting polymorphic match-up.

Well done, Zach_Attakk !

Here's a star
and favorited.



[Please log in to post a comment]