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

Since we've already got classic Minesweeper by @TeamPuzel (and because someone in the thread very specifically suggested it) I felt like starting on Solitaire to add to the classic Windows games collection!

It's mostly just graphics for now and a little bit of UI work to get it in a window. I'm still working on the Queen and King card graphics, but wanted to get this out there for perhaps some feedback on the trajectory I'm on.

No promises about when it'll be done--I'm mostly into doing graphics but am looking forward to tackling the challenge of getting it functional too.

I hope I've managed to strike the right balance between authenticity and low-res adaptation in a softer, more "Picotron" colour palette!

P#143622 2024-03-18 02:53 ( Edited 2024-03-18 11:49)

[ :: Read More :: ]

I'm writing a simple toy program to get familiar with the API.

I have a string, "Hello World!", that I am intending to print centred horizontally and vertically, adapting to window dimensions on the fly.
In the top line in the screenshot I am printing it in one go, in the bottom line I am printing it letter by letter to enable a "rainbow" effect.

I noticed the two strings are spaced differently, and I realised Picotron in fact uses a variable-width font. I was allotting 5 pixels for each character in my printing routine, but as it turns out the lowercase "l" is one pixel narrower, while the uppercase "W" is one pixel wider.

How do I deal with the variable width of characters for printing and layout work? Is there an API function to get the exact dimensions of a character?

My code:

---[[ Comment/uncomment to run fullscreen/windowed
window{
    width = 240,
    height = 120+32,
    title = "Tester"
}
--]]
text="Hello World!"

function _draw()
    local width = get_display():width()
    local height = get_display():height()
    local align = width/2-((string.len(text)-1)*5/2)    -- Assuming char width 5
    cls()

--Print all text in one go
    print(text, align, height/2-8, 9)

--Print text letter by letter
    for i = 1,string.len(text) do
        print(string.sub(text,i,i),align+5*(i-1),height/2+4,i)  -- Assuming char width 5
    end

--Print CPU usage
    print(stat(1), width-48, height-7)
end

function _update()

end

Incidentally, is there a more compact method of accessing individual characters in a string like was added in PICO-8 (string[i]), or are we expected to purely use the Lua method in Picotron (string.sub(string,i,i))?

P#143132 2024-03-15 15:40 ( Edited 2024-03-15 15:43)

[ :: Read More :: ]

EDIT: The issue has been resolved! You can find your Lexaloffle key at the top of the Humble purchase page!

=================

Congrats on the release, @zep! Just purchased Picotron. I've been watching its development with an excited glimmer in my eyes over the years! It really looks like the perfect mix of specs (really excited about the wavetable sound in particular!) and I'm excited to start exploring my creativity with it.

I've been looking at how to add the product to my Lexaloffle account following the instructions on this page https://www.lexaloffle.com/account.php?page=activate, but have not had any luck with it. Is it correct that the Humble purchases page for Picotron simply does not have the 'Lexaloffle Account Activation' button yet?

P#142956 2024-03-14 20:37 ( Edited 2024-03-21 03:20)