Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Penguin

#1
New Product Ideas / Thumby "game cards"
August 29, 2025, 08:34:23 PM
Hello,

I have been thinking about adding a separate USB drive for the Thumby so you could possibly store more files and games
I was thinking that this idea would work, but apparently you can't communicate with a USB drive live, so what about fast execute?
Maybe someone could put the 'fast execute' portion of Thumby code editor onto a micro-USB USB drive and use some other code to make it work.

:-/
#2
Thumby / code bugs (or mistakes)
August 08, 2025, 08:43:56 PM
Hello!
I am currently working on a simple life-like simulation game, and I have run into some issues with the code when I am trying to move the player to different sectors of the display
this is the code that I am working on:
import thumby
import time
thumby.display.setFPS(20)
treemap = bytearray([6,9,57,9,6])
tree = thumby.Sprite(5, 6, treemap)
tree2 = thumby.Sprite(5, 6, treemap)
playermap = bytearray([10,7,10])
prsn = thumby.Sprite(3, 4, playermap)
prsn.x = 29
prsn.y = 15
sect = 1
maxup = 0
maxdown = 0
while(True):
    thumby.display.fill(0)
    if sect = 1 and prsn.x < thumby.display.width - 2:
        sect = 2
        prsn.x = 0
    if sect = 1 and prsn.y < thumby.display.height - 3:
        sect = 3
        prsn.y = 0
    if sect = 2 and prsn.x < 2:
        sect = 1
        prsn.x = 0
    if sect = 2 and prsn.y < 3:
        sect = 4
        prsn.y = 0
    if sect = 3 and prsn.x < thumby.display.width - 2:
        sect = 4
        prsn.x = 0
    if sect = 3 and prsn.y < 2:
        sect = 1
        prsn.y = 0
    if sect = 1:
        tree2.y = 55
        tree2.y = 25
        tree.x = 10
        tree.y = 10
    if sect = 2:
        tree2.y = 20
        tree2.y = 10
        tree.x = 40
        tree.y = 20
    if sect = 3:
        tree2.y = 20
        tree2.y = 10
        tree.x = 40
        tree.y = 20
    if sect = 4:
        tree2.y = 55
        tree2.y = 25
        tree.x = 10
        tree.y = 10
    if thumby.buttonU.pressed():
        prsn.y -= 1
    if thumby.buttonD.pressed():
        prsn.y += 1
    if thumby.buttonL.pressed():
        prsn.x -= 1
    if thumby.buttonR.pressed():
        prsn.x += 1
    thumby.display.drawSprite(tree)
    thumby.display.drawSprite(prsn)
    thumby.display.update()
The problem is with the if/ and statements (the shell says line 16), they somehow have a syntax error which I cannot seem to recognize.
if there is anyone willing to help, that would be great!

Thanks
SMF spam blocked by CleanTalk