You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • @Abhinav

    ...quite a long time ago, there was a conversation about Exploring 2.8" Color TFT Touch LCD by Pacman Game attempt

    It was quite a challenge then... and not much less today...I also had done is the labyrinth: an encode description with a drawing algorithm, but it was a bit overwhelming for the Original Espruino board - speed, memory - and - last but not least - the bit serial display (and the Espruoino driver module that puts out dot by dot).

    I can imagine for Bangle.js is to work with sprites... you already talk about this... but I would not rotate them but rather have 4 (or 8) predefined pacman images that I would just copy around. It may get tight with memory, but speed is much better and to me more important, and speed will also be better because byte serial vs bit serial communication w/ the display. Slowing down is the fact that you have to draw every moving thing twice: draw the to see it and draw to hide it, and this all over and over again...

    Enjoyed very much the clip you published.

    I watched the clip after I read and responded...

    To make it look cool, you may need more than 8 pac man images since your packman goes in a circle rather than just in x and y axis direction.

    ...so I have alternative ideas for you:

    • Compose your packman with a filled circle overlaid by a triangle of different angles. I did this for 'simulating' ui buttons with a border. Outer, border-color filled rectangular w/ rounded corners overlaid by an inner/slightly smaller, body-color filled rectangular. With that I can have variable fat - or slim -border 'lines' for any size of button... and can make it even size dependent... and the filling is obviously not that slow... and for sure does not eat code space and JS cycles (it's all part of the Graphics object of Espruino firmware).

    • Define the vertices of a polygon with 12 or 20 or 24 'corners' - translate it with move and rotation and draw it in about three ways: plain filled 'cirle', 'cirle' with one wedge excluded and 'circle' with two wedges excluded (could also be 2 or 4 for polygon with higher of corners. I used a polygon instead of a circle in my ui elements - radio button - because resolution is so low and sufficient corners in a polygon make it look like a circle... ;-)

    If you make it smart and - may be - adjust the graphics layout accordingly / w/ compromise, you are up to something fast and entertaining...

About

Avatar for allObjects @allObjects started