08-25-2021, 08:02 PM
(This post was last modified: 08-25-2021, 08:05 PM by nitrofurano.)
since a long time i was thinking how simple or possible would be using sprite engines/libraries on zxbasic-compiler (just like those used on z88dk and so on)
so i started to try this (very glitchy and inefficient, as the code shows... )
(wsad or cursors for moving)
so, any idea of using "true" sprites instead of that attempt above?
so i started to try this (very glitchy and inefficient, as the code shows... )
(wsad or cursors for moving)
Code:
ink 1
border 1:ink 5:bright 1: paper 1: cls
sub putudgsprite(txp1 as uinteger,typ1 as uinteger,tad1 as uinteger)
poke uinteger $5C7B,tad1+(7-(typ1 mod 8))+(txp1 mod 8)*32
print at int(typ1/8),int(txp1/8);"\A\C"
print at 1+int(typ1/8),int(txp1/8);"\B\D"
end sub
yo=0:xo=0
putudgsprite(xo,yo,@udg01)
x1=128:y1=128
do
cn1=((255-(in 64510)) band 2)/2 bor ((255-(in 65022)) band 2) bor ((255-(in 65022)) band 1)*4 bor ((255-(in 65022)) band 4)*2 :'- wsad
cn2=((255-(in 61438)) band 8)/8 bor ((255-(in 61438)) band 16)/8 bor ((255-(in 63486)) band 16)/4 bor ((255-(in 61438)) band 4)*2 :'-7658
cn0=cn1 bor cn2
x1=x1-((cn0 band 4)/4)
x1=x1+((cn0 band 8)/8)
y1=y1-((cn0 band 1)/1)
y1=y1+((cn0 band 2)/2)
over 1
putudgsprite(xo,yo,@udg01)
xo=x1:yo=y1
putudgsprite(x1,y1,@udg01)
pause 1
loop
do:loop
udg01:
asm
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %11111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %01111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %10000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00111111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %11000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00011111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %11100000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00001111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %11110000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000111
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %11111000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000011
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %11111100
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000001
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %11111110
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
defb %00000000
end asm
so, any idea of using "true" sprites instead of that attempt above?