CMM2: Game: CrateAway - Feeling pushy? Push some crates!
Author | Message | ||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1110 |
Here's my latest diversion: Many should recognize this as a clone of a particular pushing game with a Japanese name. However, everything in my version is my own creation and should be copyright safe. The game has 12 levels built in to get you started. Many more levels can be found on the internet by searching for "Sokoban levels". Make sure you use txt formatted levels. CrateAway15-vp.zip ' Use the arrow keys to move ' Z - undo ' R - restart level ' Q - quit ' B - play built-in levels ' L - load levels file ' N - 'undocumented' skip to next level Visit Vegipete's *Mite Library for cool programs. |
||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 470 |
Nice. Thanks. Any firmware version info considering the flux we are in with the marvelous enhancements being added. I am going to look into the levels online but could you indicate how to add them, or will that become clear from the files? Wait I looked at the main program and you have them in data lines. Can you just append level layouts at the end of the list or do you need to alter the code to gain access to them? |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1110 |
Should be no firmware requirements. You could just add more data lines. No program change required. But better would be to put them in a separate text file. Then they are easily shared. Save this as a text file and it can be played. (Not much challenge though.) ######################### # + # # $$$ $ $ $ $ $$ # # $ $$ $$ $$ $$ $ $ # # $ $ $ $ $ $ $ $ # # $ $ $ $ $ $ # # $ $ $ $ $ $ # # $$$ $ $ $ $ $$$$ # # # # # # ... .... ... ..... # # . . . . . # # ... ... .. . # # . . . . . # # . . . . . # # ... .... ... . # # # ######################### ;A sample level ;By vegipete, Dec 10,2020 I have seen some level text files out there that put the ";name" before the level itself. These will work too, although I expect the first level to be blank and then each name will get assigned to the previous level. And the last level won't appear. Edited 2020-12-11 06:40 by vegipete |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 370 |
Fantastic! I look forward to playing this at the weekend. I do love a good puzzle game! |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4305 |
@ Vegipete, I love this, this brings back good memories. To bad I don't have a CMM2 yet. Maybe this is a good reason to finally buy one. Volhout |
||||
PilotPirx Regular Member Joined: 03/11/2020 Location: GermanyPosts: 69 |
Great Game Vegipete, but i get an error pressing B to start the game. "Error in line 386: Syntax" Which Firmware Version do we need? |
||||
fuse Newbie Joined: 26/07/2020 Location: United StatesPosts: 2 |
Fixed line 386 issue and notblack issue CrateAway15a.zip |
||||
PilotPirx Regular Member Joined: 03/11/2020 Location: GermanyPosts: 69 |
Game starts now with button B, only Button "R" for restarting level gives "Error in line 168: Syntax", all other buttons work well. Very good work and nice graphics!!! |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 479 |
Amazing Vegipete. Unfortunately this EOY I'm stuck with some personal problems and only next year I will be back to my CMM2 projects |
||||
fuse Newbie Joined: 26/07/2020 Location: United StatesPosts: 2 |
This fixes R (Restart) in v5.05.05 CrateAway15b.zip |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1110 |
I guess I did use a command or 2 only found in recent firmware. Oops, sorry. math add boardstart(),0,board() appears on line 168 and the reversemath add board(),0,boardstart() appears on line 386.Fuse's solution does the trick. Good work. An alternative to try is math scale boardstart(),1,board() which has been available in the firmware much longer, since 5.05.04I also used the colour "NOTBLACK" (in line 470) which is quite new. Fuse solved that by using BLUE instead. That actually looks quite good. Darker is better due to the anti-aliasing so I would suggest changing "rgb(notblack)" to "&h000040" Why, you ask? I wanted the "Solved" message to scroll into view, so I turned it into a sprite. But ordinary black and sprites don't play well together. Black is treated as transparent, which would make a mess of the solved message. That's why "notblack" was created. |
||||
mclout999 Guru Joined: 05/07/2020 Location: United StatesPosts: 470 |
There are so many Levels out there. Here is a good site. Looks like they are in the proper format. https://www.sourcecode.se/sokoban/levels I was surprised by how many there are out in the wild. |
||||
lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3161 |
A version that also runs on the Armmite F4 with IPS/OTM8009A 800.480 LCD To add to another one of VegiPete's gems, I've tested this on 5 hardware configurations: 1) CMM2 with VGA and keyboard 2) CMM2 with VGA and PC console 3) CMM2 with VGA->HDMI->USB3 and PC console 4) F4 with PC console 5) F4 with hat and keyboard To handle the varying input (particularly arrow keys when using the PC console or F4 or CMM2), I replaced all INKEY$ with _INKEY$() and provided this FUNCTION _INKEY$ Function _inkey$() local ky$ ky$=inkey$ if asc(ky$)=27 then ' escape sequence ky$=inkey$: ky$=inkey$: ky$=ucase$(ky$) If ky$="A" Then: ky$=chr$(128) ' up arrow ElseIf ky$="B" Then: ky$=chr$(129) ' down arrow ElseIf ky$="C" Then: ky$=chr$(131) ' right arrow ElseIf ky$="D" Then: ky$=chr$(130) ' left arrow ElseIf ky$="5" Then: ky$=chr$(136) ' pgdn ElseIf ky$="6" Then: ky$=chr$(137) ' pgup ' Function keys are ??? EndIf endif _inkey$=ky$ end function Otherwise I had to replace blits of the sprite graphics page on a separate CMM2 page with F4 sprites created with BLIT READ and BLIT WRITE. The F4 looked to have generous memory compared to most other micromites, but compared to the CMM2, it's miserly--114K compared to 5M+. I could not build all the necessary sprites without running out of memory. I wanted to keep the walking/pushing man on the instruction page--that took 29 sprites and left 4K of RAM remaining (other program RAM included). (Note--VegiPete used the CMM2s mirroring parameter to flip the walking man and pushing man--I had to reverse the pixels on the bmp image screen and save walking left and pushing left and right. It would be useful to save memory on the F4 by providing that mirroring parameter to BLIT WRITE.) I squeezed some array sizes to gain more memory. Then to get the sprites to play the game, I had to BLIT CLOSE all 29, reload the sprite image .bmp file and set another 7 game tile sprites. Other than the blits, there was not much that had to be changed. The CMM2 game plays with 500x500 pixels, so I had to squeeze the vertical down to 480. That changed sprite depth by a pixel. MATH ADD is also not available on the F4. It's used to make a copy of the game board. I used enclosed FOR loops to copy the double-dimensioned array. F4 MMBasic doesn't have include files, so I didn't try to provide that way to add more games. The text file games found on the internet can be pasted into this program. Zipped MMBasic file with .bmp sprite file: CrateAwayF4.zip F4 on Fruit of the Shed ~ Edited 2021-04-26 01:51 by lizby |
||||
vegipete Guru Joined: 29/01/2013 Location: CanadaPosts: 1110 |
Cool. Vegipete approved! |
||||