MMBasic: Knightmare Game


Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5768
Posted: 07:12pm 17 Nov 2025      

@Leo,

With picomite V6.01.00 rc15 (last one posted by Peter) you should be able to port KM to the pico.

Martin.H has converted your PNG's to BMP's in RGB121 format. Background RGB(Myrtle) / color number 2 for transparencey.

In this demo you see how it is used. Works really fast. You may be able to run your birds at same speed as CMM2.

You could combine maps and objects 2 in one BMP and use flash slot 3
Then use flash slot 2 for the other file (since it's X dimension is different).

-or- just put them side by side (832x240 nibbles = 99840 bytes). That should fit in one slot. Slot 3 should be compatible with most software. Petscii Robots also does that.

 'test for blit from flash slot
 'require picomite V6.01.00 rc14 or newer.

 'load a bmp into flash slot 3, clearing old content (erases library)
 Flash load image 3,"objects2.bmp",o

 'setup 2 planes
 MODE 2
 CLS RGB(cerulean) 'plane N
 FRAMEBUFFER layer 2 'layer L over N with Myrtle as transparent color

 'the screen should be completely blue-ish now since L is transparent

 'copy an object from flash slot 3 to N
           slot  layer    flash XY screen XY size XY
 Blit flash 3,     N,       64,0,    20,20,   16,16   'do not omit copying myrtle
 Blit flash 3,N,64,0,40,20,16,16,2 'omit copying myrtle

 'copy an object from flash slot 3 to L
 'framebuffer write L
 Blit flash 3,L,64,0,60,20,16,16 'do not omit copying myrtle, but L is transparent for Myrtle
 Blit flash 3,L,64,0,80,20,16,16,2 'omit copying myrtle

 n=32 'position X offset for test

 Do
   For x=0 To 15
     xpos=x*16:xrem=(15-x)*16
     Timer =0
     Blit flash 3,L, xpos,80, n,     40,xrem,16
     Blit flash 3,L, 0,   80, xrem+n,40,xpos,16
     tm=Timer
     Pause 20 'without the pause it would not be visible so fast.
   Next
 Loop While Inkey$=""
 Text 0,0,"2 blits take "+Str$(tm)+" ms"

End


Put this program and objects2.bmp in one folder, and run.

Volhout
Edited 2025-11-18 05:25 by Volhout