Log In  
Follow
Werxzy
[ :: Read More :: ]

Cart #pss_example_project-7 | 2024-07-21 | Embed ▽ | License: CC4-BY-NC-SA
3

load #pss_example_project

You can create mods for Picotron Solitaire Suite from this example project cart. the cart contains a single solitaire variant from which you can learn how the api works and build your own games from. Try to keep all changes you make inside cart_games/ and card_backs/. Though you should probably adjust suite_scripts/main_menu.lua to better match your game.

I highly recommennd reading the READMEFIRST file inside the cart.

All the functions inside cards_api/ and suite_scripts/ should have comments that help tell you what they do. The readme files in for the suite and api git repositories also have some information on the available functions. You can also look at the games inside the suite in order to get an idea of how those games apply the api and suite functions.

[ Picotron Solitaire Suite git repository ]
[ Cards API git repository ]

If you make any mods, you can post them on the BBS so other people can play them on their own or download them through the mod manager on the main suite cart. But make sure you add the tag solitaire-suite-mod and add this cart as a fork, which can be found by clicking the edit button below your cart on the bbs or be done by submitting the cart through (https://www.lexaloffle.com/picotron.php?page=submit&respond_to=pss_example_project). These are important to help people search for mod carts and for future functionality for a mod explorer.

[ Picotron Solitaire Suite ]

P#151601 2024-07-21 14:23 ( Edited 2024-07-21 14:33)

[ :: Read More :: ]

Cart #pepper-4 | 2024-06-29 | Embed ▽ | License: CC4-BY-NC-SA
6

load #pepper

Pepper is a lua PrEPRocssing script that can help create different builds from the same code.

Source is under the MIT license at https://github.com/Werxzy/pepper.p64

Pepper works by looking through all the lua files in a loaded project and searches for specific labels, which can then be used to remove or add code before running or exporting. It takes 3 different forms: 1. A tool in the tooltray from which you can select an initial .pepper config file. 2. A window that can be run without installing. 3. A terminal command. After installing, you can type pepper into the terminal to get more info.

Upon installing:

  • Pepper will be copied to /appdata/system/tooltray/
  • Startup.lua will be created OR appended to at /appdata/system/ to have pepper open on boot up
  • Startup.lua will also get a copy command to put pepper into /system/util/ for use in the terminal or other projects

Uninstalling will remove all of these. (for startup.lua, only the relevant lines will be removed.)

Pepper is useful for creating builds for debugging, full vs demo, or any other case that requires creating different versions. For me, I'm primarily made this for creating an empty example project for Picotron Solitaire Suite.

-- Example code

--#def debug true

-- leave the default path uncommented

--#if not debug
print("debug mode disabled")
--[[#else
print("debug mode enabled")
--#end]]

-- values are actually run as lua code in a fresh env.

--#def val debug and 1 or 2
-- similar to "val = debug and 1 or 2"

--#if val > 1
--[[#elseif val == 0
--#else
--#end]]

-- A .pepper file can also be created to state initial parameters
P#149138 2024-05-29 19:46 ( Edited 2024-06-29 22:37)

[ :: Read More :: ]

Cart #grid_wallpaper-0 | 2024-04-11 | Embed ▽ | License: CC4-BY-NC-SA
7

Made a wallpaper that can react to mouse position and movement. It uses some userdata stuff that I've shared before. There's extra settings inside _init(), which I've set to be a bit mild to make the effect less distracting.

Other line options

P#146368 2024-04-11 15:28

[ :: Read More :: ]

Cart #solitaire_suite-3 | 2024-07-21 | Embed ▽ | License: CC4-BY-NC-SA
141

load #solitaire_suite

no sound currently added
saves don't work on bbs right now
the mod manager isn't guaranteed on the bbs right now

Release 0.2.0

Version 0.2.0 brings a new solitaire game, a mod manager, and a bunch of smaller changes. Thanks to anyone whose been following the updates and joining the streams. Also thanks to Louie Chapman for his contributions (2 solitaire variants, a card back, and helping test that it actually works.), SoundDotZip for the aseprite to picotron image plugin, Fletch for an animated card back, and imjustkerb for testing out the example project.

The suite currently has 7 solitaire variations main

  • Klondike Solitaire
  • Solitaire Too
  • Golf Solitaire
  • Spider Solitaire
  • Falling Solitaire

2 of which were made by Louie Chapman

  • Huntsman Solitaire
  • Trapdoor Solitaire

Custom Mods

To create your own mods containing new card games or card backs, you should start with the [ example project cart ]. or load it in picotron with #pss_example_project. Currently the bbs doesn't support fetching carts (I thought, but it seems fine right now??), but will eventually get a protocol to allow it.

When working a mod, I would recommend looking at the README in the example cart or the Solitaire Suite git repository for better details. Though I did add a lot of comments to the code to help explain what each part does.

[ Picotron Solitaire Suite git repository ]
[ Cards API git repository ]

Picotron Solitaire Suite uses submodules so you will likely need to do git submodule init then git submodule update. Though someone may know a better way of doing this. Please only submit pull requests to the dev branch. Any custom game variants or card backs can be added inside their respective folders inside /appdata/solitaire_suite/.

After 0.2.0

After 0.2, I'll be working on a few other projects before returning to work on 0.3, where I'll likely add a proper sound effects and music manager. Also the new fetch protocol is added before then, I'll add it to 0.2.1.

Changelog

version 0.2.0

  • Added game, Falling Solitaire
  • Added mod manager
  • Added settings window and menu bar
  • Updated main menu graphics
  • Added ENV encapsulation for the solitaire variants
  • Added transitions between the game and the main menu
  • Changed card back sprites to be generated instead of premade
  • Removed game_load() function requirement
  • Added 2/4 suit color setting for normal solitaire
  • Fixed a bunch of bugs

= api changes =

  • Added hand stack
  • Added card draw occlusion
  • Added a card generation function
  • Added hover events for stacks

Version 0.1.1

  • Fixed grammar and wording of some rules text
  • Fixed new game in trapdoor solitaire sometimes not dealing the cards
  • Fixed double clicking aces in spider solitaire getting stuck
  • Fixed huntsman card positioning when shuffling for a new game after emptying the deck
  • Fixed buttons being pressable while shuffling or any animations were playing

= api changes =

  • Updated stack dropping to search a slightly wider area for which stack to place the cards on
  • Added stack_collecting_anim and stack_shuffle_anim functions to simplify the reset process
  • Updated shuffling a bit to better randomize the cards

0.1.1b

Fixed error or bug that would occur when double clicking a card in trapdoor solitaire.

P#145162 2024-03-30 20:31 ( Edited 2024-07-21 14:55)

[ :: Read More :: ]

Cart #shmup_1k_werxzy-0 | 2024-02-23 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

After seeing LokiStriker's and Achie's shmups made in 1024 compressed bytes, I wanted to give it a go.

Here's the uncompressed source code.

--1k shmup
--werxzy

-- enemy data
ty=split("⁶:425affffe7662400,0.01,0,7,0,0.3,0,-0.0001,2,5,5`⁶:425affffe7662400,0.01,0,7,0,1.1,0,-0.01,1,3,3`⁶:22227f7f2a361c08,0,0,9,0,0.3,0,0.02,4,1,3`⁶:425affffe7662400,0,0,13,0,0.1,0,0,3,30,20`⁶:3c42bdbdbda5423c,0,0,5,0,0.25,0,-0.0005,5,20,25","`")
-- bullet data
bty=split("●,1,0,0,0.8,1,60`✽,1,-15,15,0.4,3,200`✽,0,-120,10,0.4,7,100`\feミ,0,0,180,1,2,20`✽,1,0,36,1,10,30","`")
cartdata"shm1k_werx"
function _init()
    en,bul,pb,px,py,ph,pi,pc,sc = {},{},{},64,80,3,0,0,0
end

function _update60()
    cls()
    if ph ~= 0 then
        -- spawn regular enemy
        if t() % 2 == 1 then
            e=add(en, split(ty[rnd{1,2,3}]))
            e[7]=rnd(e[2])-e[2]/2
            e.r,e[2]=rnd(20),rnd(100)+10
        end

        -- spawn boss enemy
        if t() % 20 == 1 then
            e=add(en, split(ty[rnd{4,5}]))
            e.r,e[2]=rnd(20),64
        end

        -- player movement and drawing
        p_=btn(4)and 0.5or 1.2
        px+=(tonum(btn(1))-tonum(btn(0)))*p_
        py+=(tonum(btn(3))-tonum(btn(2)))*p_
        px=mid(px,120)
        py=mid(py,120)
        ?(pi%20<=10and"⁶:081c362a7f7f3614"or""),px,py,11
        -- player fires
        if pc<=0 and btn(4)then
            pc+=10
            add(pb,{"⁶:1c3e3e1c1c080800",px,py,3,0,-3.5,0,0})
            ?"\as3i7gc",0,0
        end

        -- update bullets, and enemy ships
        for t in all{pb,en,bul} do
            for o in all(t) do
                o[2]+=o[5]
                o[3]+=o[6]
                o[5]+=o[7]
                o[6]+=o[8]
                if(not col(o,0,0,128,128))del(t,o)
                if o.r then
                    o.r-=1
                    if o.r<0then
                        b=split(bty[o[9]])
                        o.r=b[7]
                        nb(o[2],o[3],unpack(b))
                    end
                end
                ?unpack(o) -- draws ship or bullet
                 -- check player collision with enemy ships or bullets
                if pget(px+3,py+2) ~= 0 and pi==0 and t ~= pb then
                    ph-=1
                    pi=90
                    if(t==bul)del(t,o)
                    ?ph==0 and "\a<i6g1g2g1g2g1g2g1" or "\a<i6g1",0,0
                end

                if t==en then
                    -- check collision with each bullet
                    for b in all(pb) do
                        if col(o,b[2],b[3],5,5)then
                            del(pb,b)
                            o[10]-=1
                            ?o[10]==0 and "\a<i6g1g2g1g2g1g2g1" or "\a<i6g1",0,0
                            if o[10]==0 then
                                del(t,o)
                                sc += (o[11]>>16)*50
                            end
                        end
                    end
                end
            end
            if t == pb then
                pset(px+3,py+2,0)
            end
        end

        for i = 1,ph do
            ?"♥",i*6,118,8
        end

        -- high scores
        ?tostr(sc,2),6,1
        ?tostr($0x5e00,2)
        poke4(0x5e00, max($0x5e00, sc))
        -- cooldowns
        pi = max(pi-1)
        pc = max(pc-1)
    else
        ?"game over\n"..tostr(sc,2),50,50
        if(btnp(5))_init()
    end

end

function col(o,x,y,w,h)
    x-=o[2]y-=o[3]
    return x<8and x+w>0and y<5and y+h>0
end

-- bullet generation function
function nb(x,y,ch,pt,as,ad,sp,c)
    a=atan2(px-x,py-y)*pt+as/360
    for _=1,c do
        add(bul,{ch,x,y,8,cos(a)*sp,sin(a)*sp,0,0})
        a+=ad/360
    end
end
P#141804 2024-02-23 02:23

[ :: Read More :: ]

I've been working on a table to binary converter that can help compress data and store it in cart rom. I know there have been different attempts in the past, but this version aims to fit only the necessary data and leaves the types to a format string. Though it's only really useful if you have some of the following.

  • A lot of data in tables
  • A consistent and known table format
  • A variety of table formats
  • Multiple carts

It works by taking in a table, a writing address, and a format, that generally look like this

tab = {1,2}
form = "[#8,#8]" -- an indexed array of 2 unsigned 8-bit integers
-- form = "[#4,#3]" -- also works with a different number of bits (up to 16)
tab2bin(tab, 0x8000, form) -- compress table to binary at 0x8000
tab2 = bin2tab(0x8000, form) -- decompress table

Though if a table can a varying number of entries, so it instead it would be better to loop through entries.

tab = {1,2,4,8,16,32,64,128}
form = "[#8(#8)]" -- can have up to 255 entries due to looping through (#8) a number of times read from the previous #8

There are also ways to store values that are expected to have decimals or be in a different range

tab = {-10, 1.25, 0x1234.5678}
form = "[#8-128,#8>4,#16>16@dec#16+dec]"
-- "-" subtracts from the read value 
-- ">" shifts the read value right
-- #16>16@dec#16+dec reads the first 16 bits and last 16 bits of a full fixed-point number and stores them in 32 bits

There's also support for strings, booleans, tables with keys(though not mixing them with indexed tables), and custom compression/decompression functions.

The table to binary (tab2bin) compression function is about 913 tokens. While the binary to table (bin2tab) decompression function is about 536 tokens. However, some of the lines of code can be removed to reduce the token count. I would recommend storing your data in a string format initially, only using tab2bin when packing the data for the final carts, and only using bin2tab in the final carts.

https://github.com/Werxzy/tab2bin

The full source and more details are on the github page, since there may be changes in the future. Feel free to send any issues or pull requests to help improve it.

P#139161 2023-12-25 15:54

[ :: Read More :: ]

Cart #sb_1800_v1-2 | 2023-10-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

I recently finished a game for the Cre8 Jam. You control a robot through commands to move through and scan a 3d environment. I would have added a bit more or fixed it up better, but I'm about out of time for the jam and really low on tokens. Even after using special functions to lower the token count.

You can get more information through the HELP command, but the main commands are:

MOVE (direction) (amount)
TURN (left/right) (amount)
WAVE
SWITCH [name]
SCAN (dot size)

And another important one is RSCAN, which is just SCAN, but repeatedly scans.

I would highly recommend checking out the itch.io page, as its design is special for this game.
https://werxzy.itch.io/sb-1800 The source code for the game and the map editor are also available on the itch.io page.

After an update you can now use controller inputs

MOVE - up/down
TURN - left/right
WAVE - X
SWITCH - O

SCAN is automatic

Saved data is shared between the Command and Controller modes.

P#135093 2023-09-29 08:48 ( Edited 2023-10-18 22:23)

[ :: Read More :: ]

Cart #slime_light-3 | 2023-08-29 | Code ▽ | Embed ▽ | No License
17

I just finished a game for a 1-bit game jam, requiring the use of only 2 colors . Slime's light is a small puzzle game that uses light and shadow to activate and deactivate doors and lamps. Unfortunately, I had to minify the code to make it fit into a single cart. You can access the unminified code on the itch page.

Controls:
Arrow keys - move
X - pickup / drop
Z - slow movement

P#133251 2023-08-19 03:42 ( Edited 2023-08-29 19:48)