Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Christmas puzzle
#1
Hi,

Merry Christmas all, and best wishes for a fun, healthy, 2026.

Here's a little seasonal puzzle. Move the pieces in the lower part of the screen by holding the left mouse button down, and dragging them into the grid (above left). Release the button to release the puzzle piece in the correct place in the grid.

All the best - Kevin.


.zip   Xmas puzzle.zip (Size: 3.67 MB / Downloads: 11)
Reply
#2
Very cool! I even liked the fireworks!
Logic is the beginning of wisdom.
Reply
#3
(12-16-2025, 04:28 PM)kevin Wrote: ...
Here's a little seasonal puzzle. ...

What a wonderful puzzle !  I only just realized - thanks to your code - how the image slicing is done. I hadn't quite grasped the approach until I saw your implementation. I truly appreciate you sharing it !  But just to confirm, the image itself hasn't actually been divided yet, has it ?

Code:
set window "Tiles", 800,600
set redraw off

' Load and slice image into 8×6 tiles
img = loadimage("art/xmas.png", 8, 6)

' Draw all 48 tiles in order (0 to 47) in a grid
do
    cls
    i = 0
    for y = 0 to 5      ' 6 rows
        for x = 0 to 7  ' 8 columns
            draw image img, x*80, y*80, i
            i = i + 1
        next
    next
    redraw
    fwait 60
until keydown(KEY_ESCAPE)
Reply
#4
I solved it! Well put together! Thank you for the game!
Reply
#5
"But just to confirm, the image itself hasn't actually been divided yet, has it?"

That's right. You could use any complete image, and NaaLaa can split it into small tiles - the tilemap editor does this, as well as any sprite sheet routine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)