Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get-Put Sprite Erasing
#1
I can't get the GET-PUT to work. I have a randomly generated pixel background, and I'm trying to GET a block of it where some lines will be drawn so I can PUT it back over to erase the sprite before drawing the next frame. Instead, it draws black! I'll include the relevant code.

Code:
dim sprite(150, 150) as integer
screen 20
for x = 0 to 1024
    for y = 0 to 768
        c = rnd * 15 + 16
        pset (x, y), c
next: next
sleep
for c = 1 to frames
    get (0,0)-(101, c+1), sprite
    phaser(100, c)
    sleep 10
    put (0, 0), sprite
    brush(100, c, 0)
next i
Phaser is a sub which draws lines from (1,1) to (x,y). Brush draws a thick spot on the screen.
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply
#2
Code:
put (0, 0), sprite, pset
Reply
#3
Thanks Plasma, it works!
In the beginning, there is darkness – the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)