It's the fourth TweetTweetJam! My entry for this Jam is a stripped-down OutRun clone in 559 characters.
There's a couple things I'm proud of in this cart, so I'm posting an annotated, less-minified version of it below.
Controls
Use left and right arrows and stay on the road as long as possible! Sorry, if you crash you may have to refresh the page or reload the PICO-8 widget.
Code
Annotated code
This is pretty slick, you've got most of a regular racing game here.
I did notice a few things that could be minimized even further, such as the $ operator in place of peek4. Looks like you could pack even more into a sequel.=)
It is! I didn't have enough left in my 560 characters to restart it, although if I'd known about $ I might have had enough for it!
Oh, one other thing I was thinking of was the directional control. While you may still need to multiply the whole output value by a constant to get the right movement amount (the default is 2 pixels/frame), you can replace this:
a=btn()&3
if(a%3>0)a=6-4a
x+=a3 b=-a/2 a+=b (45 characters)
with this:
a=btn()
x+=a%4-3*(a%2) (22 characters)
Hope this comes in handy!
Oh, does it? Sorry. I did a basic check of the code to see the value outputs, and saw some similarity in canceling out movement from the other side using multiplication and subtraction, but maybe I missed a layer. Well, hope it'll be useful for something, anyway.
Just means I've got you fooled, I guess :D
I hope you enjoyed looking through the code! It feels a little bit like showing how the magic trick works to post the annotated source, but I've learned a lot from comments people have been giving me!
[Please log in to post a comment]