Log In  
Follow
axnjaxn

Scientist, engineer, hobbyist / Seattle WA

[ :: Read More :: ]

Cart #textfit-0 | 2023-12-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Hello again, Toy Box Jammers!

This cart has a few tools that are handy when using text.

By editing the text in this cart, and rerunning it, you can encode all the text for your game in a string, while setting the maximum width and height of individual pages. It can also embed x- and y-offsets so that your text prints centered without requiring any additional code (just print!), and optionally, you can have it return the width and height of each text box so that you can put nice borders (such as the included "speech bubble") around it.

Simply include one of the two decode functions in your program, and call it with the text that's copied to the clipboard after running this cart, and the decoder will return a table organized into:

table[string_number][page_number] (stored as a str)

or

table[string_number][page_number][1...3] (stored in w, h, str order)

P#139050 2023-12-22 22:43

[ :: Read More :: ]

Cart #loadfont_axnjaxn-0 | 2023-12-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

This is a small utility cart for folks working on Toy Box Jam 2023: you can paste one of the fonts into the spritesheet and run the cart to copy a pasteable version for your carts, or use the code directly. I've set it up to take characters beginning at the space and running through 0x7F, but it can be easily modified as you see fit.

You can either paste the relevant routines and spritesheets into your own cart or run this, then paste the command (which includes the relevant P8SCII command) into your cart at a cost of two tokens.

EDIT: I've been told that the embedded version has problems displaying the font snippet I used; you may have to run this or grab the P8 to get the correct results if you're pasting in the font I used here.

P#138914 2023-12-19 22:32 ( Edited 2023-12-22 21:30)

[ :: Read More :: ]

I was working on an earlier version of this tweetcart when I noticed a problem with ord used to poke in a single call (i.e. the three-parameter version).

The relevant portion:

s="ンH!\0イTvzw」😐゛\"%l_b<く゛■}ト0aOヤE⁘~わ、そ」う1U゛^Wヌ}ろ014ャ   ⁸+Zc=:•ᶠ⬅️~ふO7dウ   ➡️  イ⁙★wき&□0◜▶せ~p⁵\n:リ hU>ᶠみ○dI、U)7&⁸とv3r³\"ふ\"∧a]Z。F🐱■゛tᶜv¥⁷C],□y゜ウ+ふ$し+m&WIニ~_¥ホrへWW|Y7}Cd゛}ᵇ‖■へM_Eスvイ36ᵇめ-モeそ◀ラ    ▥9gKE4ヒ(=ᶠ"
poke(17152,ord(s,1,#s))
--rest of the cart

On my Mac, at least, I got:

pico8(36303,0x10ab435c0) malloc: Incorrect checksum for freed object 0x7fca4d589600: probably modified after being freed.
Corrupt value: 0x3deadbeef
pico8(36303,0x10ab435c0) malloc: *** set a breakpoint in malloc_error_break to debug

I was able to reproduce it without such a strange byte-string too, and I can almost imagine what the offending code is doing.

P#98260 2021-10-17 05:46 ( Edited 2021-10-18 20:52)

[ :: Read More :: ]

I've noticed that when I try to build a makefile for multicarts that calling export from the command line of my host machine doesn't respect root_path.

For example:

pico8 -root_path ./ -export mygame.html title.p8 intro.p8 mygame.p8

produces an html export that only gets title.p8 but neither of intro or mygame carts if the root path isn't already the pico-8 cartridge directory.

Does anybody know of a workaround short of actually changing the pico-8 system config for each new directory?

P#96771 2021-09-01 21:14

[ :: Read More :: ]

Cart #catacombae-0 | 2021-07-04 | Code ▽ | Embed ▽ | No License
2

"For ye are like unto whited sepulchres, which indeed appear beautiful outward, but are within full of dead men's bones..."

I descend, examining the catacombs by the light of a lantern.

P#94429 2021-07-04 02:31

[ :: Read More :: ]

Hey, all!

I live out in Seattle, and I think there are probably at least a few of us in or near that area. If there are enough people interested, I'd love to start putting together a group to meet up as the city reopens post-pandemic. I don't think it would take too much to run a monthly meetup, especially in a city like Seattle, and we could run tutorials / show and tells / demo sessions / collabs / local events if we got enough interest.

So who's interested? :D

P#94395 2021-07-03 04:31

[ :: Read More :: ]

Cart #literaid-1 | 2021-06-26 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

For TweetTweetJam 6, I drew again upon my backlog of childhood MS-DOS favorites, inspired by the Argo Software title Night Raid (itself a modernization of the 1981 Apple ][ classic Sabotage by Mark Allen).

Controls

Left/Right: Rotate the cannon
X: Hold to fire, release to reload

Features

  • Gradually increasing difficulty
  • Session high scores
  • The ability to destroy a large number of meeples in a matter of seconds, thereby taking an aggressive stance on the popular board game Carcassonne

Thanks

Thanks to @shy for noticing the bug in the first version of this cart and to @ElGregos for proposing the last little change I needed to get back down under the limit as I fixed it.

P#94053 2021-06-26 01:21 ( Edited 2021-06-26 16:23)

[ :: Read More :: ]

A few people have asked me for hints / a walkthrough for Bob of Thunder. Rather than just produce a video that you have to skip through, I've decided to give this hint guide to give a little nudge and let people solve things the rest of the way by themselves!

General Hints

Ljessnir, Bob's hammer, can hit switches at a distance, and will try to return to him even across the room. Try to experiment with different ways you can hit switches and different orders - all switches don't do the same things!

No matter what order you do things, there's always a way to progress, but it may be something you forgot about in a previous area. If you get stuck, try wandering back through the places you've been.

Hearts and coins respawn when you leave a room, so if you're low on health or money, you can return to any rooms that contain those items again.

The NPCs want Bob to succeed, so if you see any of them, make sure to talk to them right away!

Entrance Area

Q: How do I go further north?

Hint:

Do you see anything else you can interact with?

Hint:

Try throwing your hammer around the room to see what happens.

Solution:

Flip the switch by hitting it with your hammer.

Q: I can't figure out how to get the key so I can open the lock.

Hint:

Does it look like there are other ways to get inside that fence?

Hint:

Try other routes to see if any of them access that key area.

Solution:

You'll need to solve the east and west routes to get all the keys in this area.

Q: How do I go further west?

Hint:

Your hammer can damage the red enemies, but you need to use the environment to avoid getting zapped by the skulls.

Hint:

Did you brush up against that gray block when you grabbed the heart in the room earlier?

Hint:

Try pushing the gray block around.

Solution:

Push the gray block so that it's below the skull, then walk underneath it to shield you from the skull.

Q: I got further west, but now I can't figure out what to do!

Hint:

There's probably some way to open the door near the Bowyer's workshop.

Hint:

Have you explored the rest of the areas that are accessible to you?

Solution:

The Bowyer can open the door for you if you rescue him from the area east of where you came in.

Q: I saw something in the west area that I can't figure out how to get to.

Hint:

You don't have to get that item to progress, but there is a way to get there from a different room.

Hint:

The entrance is in the room with all the red patrolling enemies

Hint:

There are enough blocks that you can avoid getting zapped and make your way north from there.

Hint:

While I won't give you the solution for this one, you have everything you need to get there - be patient and try doing it a few different ways and you'll figure it out!

Q: How do I come back from the area to the west?

Hint:

There are other blocks you can use in the room with the skulls.

Solution:

You can push the block in the lower left corner upward to shield you from the skull at the top of the screen, then progress east.

Q: How do I go through the door to the east?

Hint:

This puzzle is designed to be solvable almost as soon as you start the game.

Hint:

If you walk up to the switch, you get stuck as soon as you flip it. Have you tried any other ways to flip the switches?

Hint:

Try using your hammer and staying outside the puzzle.

Hint:

The switches do different things, and you can flip all of them by leaving your hammer inside the puzzle.

Hint:

The bomb looks important, too!

Solution:

Flip the right switch with your hammer while standing outside the puzzle, then walk around so that your hammer flips the left switch. Walk clockwise so that the skull tries to zap you and shoots the bomb, and it will blow the door open.

Q: I'm stuck on what to do once I get through the door!

Hint:

That guy looks really uncomfortable hiding from all the monsters, doesn't he?

Hint:

You can't hit the switch, but he's standing right next to it.

Solution:

Kill all the monsters in the room, and the guy in the corner will flip the switch for you. Make sure to talk to him before you leave.

Q: I've completed the area to the east, and I've gotten the key I need to open the lock, but I feel like I'm leaving something unfinished by going further north. What do I do?

Hint:

You can get two keys in this area, and you need both of them to complete the game.

Hint:

The NPC you rescued was the Bowyer whose workshop you probably saw in the area to the west.

Hint:

What did the Bowyer say to you after you rescued him?

Solution:

You can find the Bowyer outside the workshop area to the west, and he'll let you obtain the second key.

Beyond the First Lock

Q: Which way do I go now?

Hint:

If you don't have a key to use, that means you need to go back for it.

Hint:

If you have a key, you can go east or west, and either way will allow you to make progress.

Solution:

Unlock one of the two locks and complete the area beyond it to get another key. It's easier to solve the area to the east first.

Q: How do I go further north?

Hint:

How do you plan to deal with the gray block at the top of the screen?

Hint:

If you know how you're going to deal with the gray block, you can flip the switch in the room to toggle the pegs and fight your way to it.

Solution:

Complete both the east and west areas before you progress north, then use the items you obtain to pass beyond where the block is.

Q: How do I go further west?

Hint:

The round gray stones can also be pushed.

Hint:

Try experimenting with interacting with things in the first room in a different order.

Hint:

Why are there pegs/switches in the first room?

Solution:

Raise the pegs and push the stones so that you can use one for each of the two skulls. Walk clockwise around the room, then use the stones in the upper corner to pass by the uppermost skull again, and exit through the north.

Q: I made it past the first puzzle to the west, but I'm stuck on the room with
three skulls and three stones.

Hint:

There aren't enough stones to block each skull individually. How can you block more than one skull with a single stone?

Hint:

These stones move on their own once you nudge them. Can you use that to help you?

Solution:

Push the stone toward the left of the the screen, then walk behind it as it's rolling so that it blocks the skulls as it's moving. Do the same thing along the left edge of the screen to walk down to the bottom corner and progress west.

Q: I made it past two puzzles to the west, but I'm stuck on the room with
two skulls and pegs that move on their own.

Hint:

Can you get to a position where you can observe how the room works if you don't interact with anything?

Hint:

The pegs are timed and cycle around the skulls every couple of seconds.

Solution:

Wait until the pegs are raised to avoid getting zapped, then make your way around the room and grab the key. It's easiest to go clockwise around the room and make your escape.

Q: I see some blocks that I don't know how to move. What do I do?

Hint:

You may get some ideas as to what to do after you complete the east area.

Solution:

Once you have the item from the east area, you can use it to progress beyond the blocks.

Q: I'm past the blocks, but there's still
skulls keeping me from reaching the NPC at the north end of a room.

Hint:

You can solve this puzzle with your hammer.

Solution:

Throw the hammer north, and let it hit the switch on the return flight, then walk north through the pegs. Talk to the NPC before you leave the room.

Q: How do I go further east?

Hint:

The gray blocks to the top must have some meaning, but you can't do anything with them yet.

Hint:

The switches do not do the same thing, and you can hit both with your hammer.

Hint:

If you only flip one switch, you can get to the right side of the screen, but the skull and snakes will be released.

Solution:

Open the right side of the screen, kill snakes as necessary, and flip the second switch to block the skull and open the route forward.

Q: I can't figure out how to get the key that's further east!

Hint:

You can't avoid blocking the key off with the rolling stone and gray block, no matter what order you do this room in.

Hint:

Have you explored the rest of this area?

Solution:

Retrieve the item from the next room to the east, then use it to get the key.

Q: I can't figure out what to do east of the key!

Hint:

There are two switches to experiment with, and your hammer will always return to you when you throw it.

Hint:

Try flipping the switches near the goblin to see what they do.

Solution:

Flip the left switch to open the area at the top of the room. If you leave your hammer in the central area, you can also drag it across the right switch to close off the yellow crabbers so that you can access the item along the right edge of the screen.

Q: How do I get back from the area to the east?

Hint:

Once you have everything there is to pick up in the east area, you can use what you get to return.

Hint:

You should have both a key and an electric drill.

Solution:

Use the drill to break blocks and stones. Pick up the key on your way back, and use the coins near the puzzle to keep your meter full.

Q: How do I make sure I got everything in this area?

Hint:

You can't leave the area without a new item.

Solution:

You need to rescue the Tailor, retrieve the electric drill, and retrieve a key from both the east and west areas to be able to progress.

Outside the Utility Shed

Q: How do I get to the utility shed?

Hint:

If there's a wall in the way that you can't open with the drill, there must be another way.

Hint:

Have you fully explored the previous area?

Hint:

An NPC can help you get past the wall.

Solution:

Rescue the Tailor and get all the keys from the previous area, and talk to him again next to the wall. Use the skulls to trigger the solution he produces.

Q: What does the picnic area do?

Solution:

If you've completed all the areas so far, you can find the Bowyer here, who will wish you well and refill your meters.

The Utility Shed

Q: How do I go further north?

Hint:

The closed door you see is not the way forward.

Hint:

There are two locks that you need keys for.

Solution:

Solve the west and east areas and retrieve two keys to enter the final area of the game.

Q: How do I go further west?

Hint:

Can you observe what happens in the first room if you don't do anything?

Hint:

You can make it through the first room with good timing and exit through the top of the screen.

Hint:

The three pegs don't have a switch connected to them. What else can you do in this room?

Hint:

There are three pegs and three robots.

Hint:

Try smashing a robot with your hammer or drill.

Solution:

Each robot you destroy opens a peg. Clearing the room opens the way to the key.

Q: How do I go further east?

Hint:

The key you need is in the bottom corner of the room, and the skulls can't set the bombs off.

Hint:

If the bombs keep going off, try to deal with the thing that's setting them off first, and then go for the key.

Solution:

Keep to the left of the room and destroy the robots so that their flames don't trigger the bombs, then go grab the key.

The Endgame

Q: How do I
go back to the previous areas once I encounter Hrungnir?

Solution:

In a body bag.

Q: How do I
damage Hrungnir?

Hint:

When you first try to hit him with your hammer or drill, he brags about being invulnerable to direct attacks. What does that leave?

Hint:

When he flashes blue, that means he didn't take damage.

Hint:

He can only be damaged by attacks he doesn't expect. Are there any ways you can conceal your attacks from him?

Solution:

You need to destroy the gray blocks and throw the hammer through the top of the apparatus behind Hrungnir. Lure him to the bottom and let your hammer return out the bottom so that it hits him on the return. You'll know it damages him if he retreats to the next room.

Q: How do I
damage Hrungnir the second time?

Hint:

The switch toggles all pegs in the room, and you can use it to slide the hammer through the apparatus.

Solution:

Destroy all enemies, clear some of the blocks, then slide the hammer through the apparatus on the left of the screen, flipping the switch. Repeat the process from the previous room to hit him from behind and progress. Don't forget to switch the pegs to the up position that block the skull at the top of the screen.

Q: You, the game designer, are a jerk.

Solution:

Your tears provide the nourishment that keep my skin soft and my hair shiny.

Q: How do I
damage Hrungnir the third time?

Hint:

What's the relationship between robots and pegs?

Solution:

Destroy the robots to lower the pegs, then hammer Hrungnir one last time from behind the apparatus.

Q: What do I do once
Hrungnir is defeated?

Hint:

You still have a job to do, don't you?

Solution:

Progress to the west, and flip the switch. Enjoy the ending!

P#86359 2021-01-11 18:28 ( Edited 2021-01-11 18:40)

[ :: Read More :: ]

Cart #bobthunder-4 | 2021-01-11 | Code ▽ | Embed ▽ | No License
18

I'm excited to introduce Bob of Thunder, my entry to Toy Box Jam 2!

This is probably my most ambitious cart in terms of process: it borrows heavily from the techniques I used in Astro Clerk in The Documents of Mars last year, but it has a considerably larger map requiring compression, more in terms of scripted events, and took way more planning. I plan to write up some of the more interesting parts later on.

The Story So Far


BOB OF THUNDER

In the land of Midgard, none is so mighty as THOR!

After a mead-filled night on the town, the Odinson tends to leave a trail of damage and disrepair in his wake.

You are BOB, contractor to the gods, mender of fences, and entry on several speed-dials across the nine realms.

The power's out in Vilahalla, where Thor spent all weekend partying, and your voicemail's filling up with work requests. Time to put on your steel-toed boots and defrost your pickup - it's going to be a long day!

Instructions

Bob will acquire several items as his workday progresses. He can touch most signs, notes, or villagers to see what they have to say, and you can press Z/Square on switches or hit them with your hammer to activate them.

Z/Square - Throw Ljessnir
X/Cross - Use Secondary Items

The game will autosave as you progress, most often when you cross a screen boundary or enter/exit a room.

Credits


BOB OF THUNDER

A Game by Brian Jackson for Toy Box Jam 2

Inspired by Adept Software's God of Thunder

Art and Music Contributed By:
Gruber
Tom Hall
Toby Hefflin
Lafolie
Smelly Fishsticks
Alice Stenger

Special thanks to:
<3 Emahlea
Tim Jackson
The Immortal Albatross Crew

Changes

Revision 1: Adjusted the difficulty for the last challenge.
Revision 2: Fix the color scheme on one of the NPCs
Revision 3: Fix some missing dialog colors
Revision 4: Adjust layout of rooms in the last challenge.

P#86328 2021-01-10 20:16 ( Edited 2021-01-11 06:30)

[ :: Read More :: ]

Cart #starmr-0 | 2020-11-30 | Code ▽ | Embed ▽ | No License

My favorite 2600 game has to be Activision's StarMaster. It had everything: space combat, docking maneuvers, a map. The whole nine yards.

This game only has one of those things. I'd hoped to complete it for TweetTweetJam 5, but I'm just happy it got finished at all. There are a couple tricks I'm pretty proud of in here, and I look forward to the next one!

Code:

cls()l=line
l(9)
?"🐱"
memcpy(0,24576,512)c=-64m=0n=0w=-9a=0z=8s=0j=w::_::camera(c,c)b=btn()x=b&2x-=2*b&2b\=4y=b&2y-=2*b&2for i=0,19do
q=(i^.2+t())%1*96+19p=i^.7pset(q*cos(p)+x*8,q*sin(p)+y*8,6)end
?s..0,c,58
w+=1-w\24>>3sspr(0,0,8,8,m-w/2,n-w/4,w\c*-w,w)j+=1/8if(j<0)o=atan2(m,n)u,v=m,n
u-=x+cos(o)v-=y+sin(o)circfill(u,v,j,10)p=j\8\c
j+=p*17f=-p*pget(u,v)*.9s*=1-f\8p=z%8\7*pget(0,0)z+=1-z\8if(p==9)w=-20f=9s+=10
if(p>9)j=-9f=9s+=5
b&=z
z-=b&8s-=b\8p=80-z*9q=p/2l(p-16,q-8,p,q,8)l(16-p,q-8,-p,q)a+=rnd(.1)-.05m-=x-m\c-cos(a)n-=y-n\c-sin(a)flip()cls(f)goto _

P#84872 2020-11-30 18:54

[ :: Read More :: ]

Cart #luvbomber-0 | 2020-11-11 | Code ▽ | Embed ▽ | No License
2

The Atari 2600 gave me a lot of silly memories.

Unfortunately, there were no characters to spare for realistic wood paneling texture.

This isn't my most impressive cart ever, but I had fun with it.

Code follows:

f=rectfill
cls()f(0,1,0,3,6)pset(1,2,8)f(2,0,3,4)f(2,2,5,3)f(6,1,7,2)memcpy(0,24576,512)poke(24364,3)w=64y=8d=0r=64s=0p={}h=-9m=w::_::cls(12)b=btn()y+=b\8%2-b\4%2pal(6,5+d%2)
?s,1,1,7
f(0,50,w,w,3)y=mid(0,y,32)spr(0,8,y,1,1,1)h-=.5d-=1if(d<0)d,r=r,max(r-1,9)add(p,{x=w,y=rnd(36)})
pal(8,2)for i in all(p)do
i.x-=1x,z=i.x,i.y
spr(0,x,z-2)
if(x<-8)del(p,i)
if(x==32)q=pget(12,z)f(x,z,0,z,9)
end
if(h<-8)h=w+rnd(32)g="⌂"
?g,h,58,7
m+=2
if(b>15)m=y+4
?"♥",9,m,14
if(pget(12,m+5)==7)g="♥"s+=1m=w
pal()flip()
if(q!=8)goto _
while btn()<16do
?"*",11,y,10
end
run()
P#84103 2020-11-11 04:07

[ :: Read More :: ]

Cart #tinycact-0 | 2020-10-31 | Code ▽ | Embed ▽ | No License

Who doesn't love gambling in Final Fantasy XIV?

I do. Especially when the odds are in my favor.

This FF14 Mini Cactpot "solver" takes a simple approach: average all the possible outcomes of each decision you make during the Mini Cactpot minigame, and suggest the specific choice where the average outcome is highest.

Press square to make choices and X to undo them.

P#83535 2020-10-31 05:38

[ :: Read More :: ]

Cart #vampdice-0 | 2020-08-27 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I will, on occasion, play a game or two of Vampire the Masquerade (5th Edition).

I will, on occasion, rely on borrowing dice.

Here's an alternative for kindred of less discerning tastes.

P#81231 2020-08-27 00:28

[ :: Read More :: ]

Okay, bear with me, because this is a pretty niche bug and also I can't post the actual code because it's spoilers for a demo I'm putting together.

I have code that basically works like this:

local a,b={},{}
--a loop that populates a,b with 128 nums each

::_::
cls()
--some code that involves nested looping through a,b to draw pixel-by-pixel on the screen
flip()
goto _

This is not a super uncommon design pattern for my tweetcarts. One thing I'd intended to do was encode the contents of a,b rather than the code that populates them. So I did, and the performance tanked.

Weird. Maybe there's a performance difference I'm not aware of?

What was odd is that I know a and b are local in both cases, and they take up the same storage as far as I can tell. I started poking around, and I tried this:

local a,b={},{}
--a loop that populates a,b with 128 nums each
local anew, bnew = {...my constants...}, {...my other constants...}
::_::
cls()
--some code that involves nested looping through a,b to draw pixel-by-pixel on the screen
--note that this code never references anew, bnew
flip()
goto _

Oddly, the performance still takes a hit. Even though anew,bnew are defined outside the loop. Even nil-ing them out doesn't reverse the performance hit.

Am I being silly, or is this behavior strange?

P#80528 2020-08-08 22:58 ( Edited 2020-08-09 04:07)

[ :: Read More :: ]

Cart #axnjaxn_ajml-2 | 2020-07-04 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

I couldn't resist making a cursed PICO-8 cart after someone sent me the What's Your Alex Jones Conspiracy Theory post on reddit by /u/dreggmuffin.

Given the subject matter "mad libs" is almost a double entendre.

(Press z/O button or x/X button to get a new conspiracy theory that you'll use to exploit the patriotism of your listeners!)

P#78900 2020-07-04 18:48 ( Edited 2020-07-04 18:52)

[ :: Read More :: ]

Cart #axnjaxn_packmap-0 | 2020-07-01 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

This snippet was requested on the Discord, and shows how to pack a 16x16 byte map into the cartdata. I've used the title screen of Astro Clerk just to have something non-repetitive to use to show that the behavior is correct.

P#78776 2020-07-01 21:02

[ :: Read More :: ]

Cart #astroclerkfonts-1 | 2020-06-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

This cart contains three things of interest:

  • A 6x15 font I used in Astro Clerk
  • Code for encoding your own 6x15 font in the same way (i.e. four 1-bit graphics per tile)
  • Code for decoding/printing with a 6x15 font

Inside the cart, you can use initfont to create a starting point by upscaling the system font, encode6x15 to write the sprites, and print6x15 to output the result.

P#78314 2020-06-19 21:19 ( Edited 2020-06-19 21:20)

[ :: Read More :: ]

Cart #convparade-0 | 2020-06-12 | Code ▽ | Embed ▽ | No License
10

I was working on a half-baked 3D engine when my brother texted me to tell me that my games are just like the ones on Adventure Time.

Well, I'll show him.

P#78006 2020-06-12 20:34

[ :: Read More :: ]

Cart #astroclerk-1 | 2021-01-29 | Code ▽ | Embed ▽ | No License
14

In the future, humanity will achieve world peace by offloading all of its paperwork to Mars.

You are Astro Clerk, a capable custodian of all documents, forms, certificates, contracts, and records to be found on the red planet.

Tomorrow is Mars Day, the beginning of a long weekend. Unfortunately, this year it falls on the first of the month!

Traverse the hostile terrain and rescue the common pencil-pushers from an endless night locked away completing their quarterly mars reports!


Astro Clerk is my entry for RNDGame Jam 2020, an homage to the early-90s classic The Monuments of Mars. It features 20 levels of puzzle action, autosave, high scores, and 2-bit CGA color!

With any luck, there won't be any last-minute bugs, because this cartridge is coming in hot! Screaming into the jam with 20 minutes and 0 tokens to spare, Astro Clerk is the game you never knew you wanted, but might learn to live with!


I've updated Astro Clerk to the v2.FINAL REVISED FINAL.doc Edition, now with slight improvements to the levels and ear-splitting DOS sound!

P#77202 2020-05-26 00:53 ( Edited 2021-01-29 01:58)

[ :: Read More :: ]

Cart #otrn_tt4-0 | 2020-05-07 | Code ▽ | Embed ▽ | No License
4

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

g,l=color,line
poke(24366,1)pal(2,139,1)x,f,k,n,v,z,c=0,0,1,32,0,1,64::_::camera(-c,-c)memcpy(0,88,c*c)n-=1if(n<0)n=8+rnd(30)v=rnd(14)-7
for i=490,512 do
poke4(4*i,peek4(4*i-4)+v/k)end
cls(12)for d=512,c,-1 do
q=(d+f)\40%2y=c*c/d
r=y/c*(x+peek4(4*d))l(-c,y,c,y,3-q)l(r-y,y,r+y,y,5)l(r,y,r+1,y,9-4*q)end
a=btn()&3
if(a%3>0)a=6-4*a
x+=a*3b=-a/2o="w"
?o,a-9,58,0
?o,a+6,58
?o,-a-7,57
?o,4-a,57
?z.."m",1-c,1-c
u=8h=8g(12)for y=56,60 do
s=-y/c
rectfill((a+u)*s,y+s*h+1,(a-u)*s,y)a+=b
g(8)u=10h=6
end
z+=k\11
flip()
?"oops",0,0
f+=k
if(k<22)k+=1
if(abs(r)<c)goto _

Annotated code

--otrn
--by axnjaxn
--note: lines ending in -- show where i cut a newline
g,l=color,line
poke(24366,1)--
pal(2,139,1)--
--x: car's horizontal position
--f: odometer/used in determining lines and terrain colors
--k: speed
--n: downcounter to change direction
--v: current road direction
--z: odometer for display
--c: constant 64
x,f,k,n,v,z,c=0,0,1,32,0,1,64--
::_::--
camera(-c,-c)--
--advance the road data generated in sprite memory by 22 units (max speed)
memcpy(0,88,c*c)--
n-=1--
--each new road segment is determined here
if(n<0)n=8+rnd(30)v=rnd(14)-7
for i=490,512 do
   poke4(4*i,peek4(4*i-4)+v/k)--
end
--draw terrain
cls(12)--
for d=512,c,-1 do
   q=(d+f)\40%2--
   y=c*c/d
   r=y/c*(x+peek4(4*d))--
   --for each distance along the ground, i compute the y and x scale, then draw lines
   --this ends up using like 1.5k lines to draw a 61-row tall background
   l(-c,y,c,y,3-q)--
   l(r-y,y,r+y,y,5)--
   l(r,y,r+1,y,9-4*q)--
end
--a and b are the position and slope of the car's tilt
a=btn()&3
if(a%3>0)a=6-4*a
x+=a*3--
b=-a/2--
--wheels
o="w"
?o,a-9,58,0
?o,a+6,58
?o,-a-7,57
?o,4-a,57
--score
?z.."m",1-c,1-c
--car's body
u=8--
h=8--
g(12)--
for y=56,60 do
   s=-y/c
   --might have been able to save characters by dropping the +1 and altering h accordingly. oh well!
   rectfill((a+u)*s,y+s*h+1,(a-u)*s,y)--
   a+=b
   --since the first rect (the windshield) is different, always set the color/dims here
   g(8)--
   u=10--
   h=6
end
z+=k\11
flip()
--yes, putting it inside the game loop saves a single character. it gets erased unless the loop exits.
?"oops",0,0
f+=k
if(k<22)k+=1
if(abs(r)<c)goto _

P#76082 2020-05-07 18:43

View Older Posts
Follow Lexaloffle:          
Generated 2024-03-28 15:46:15 | 0.151s | Q:74