Page 1 of 3
displaying and animating UDG's on the spectrum
Posted: Sun Jul 03, 2022 1:06 am
by Crayon21
I can enter the binary data well enough but how do I display it? I'm not talking about poking the data for the small ones either. Commodore allows you to show the sprite, the C128 has a sprite command. How do I do this on the spectrum?
Data bin (numbers) then what?
Re: displaying and animating UDG's on the spectrum
Posted: Sun Jul 03, 2022 3:15 am
by XavSnap
Spectrum 48k.
- UDG.zip
- (77.81 KiB) Downloaded 632 times
Re: displaying and animating UDG's on the spectrum
Posted: Sun Jul 03, 2022 3:21 am
by Crayon21
could you clarify the code?
Re: displaying and animating UDG's on the spectrum
Posted: Sun Jul 03, 2022 3:53 am
by XavSnap
Yes Crayon,
Code: Select all
10 CLS:LET u1=PEEK 23675+256*PEEK 23676
20 LET u2=10000:PRINT u2-INT(u2/256)*256
30 POKE 23675,u2-INT(u2/256)*256:POKE 23676,INT(u2/256)
40 PRINT AT 0,0;"\a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u";AT 5,5;u2
50 IF INKEY$="" THEN GO TO 50
60 LET u2=u2+8
70 GO TO 30
To enter UDG:
Code: Select all
9940 REM ***********************
9945 RESTORE 9940:FOR a=USR"a" TO USR"a"+7:READ b:POKE a,b:NEXT a:DATA 16,16,56,108,198,254,40,40
PRINT "\a"
Where \a = GRAPHICS +"a"
Re: displaying and animating UDG's on the spectrum
Posted: Sun Jul 03, 2022 10:21 pm
by Crayon21
got the UDG on screen finally but what if I wanted to use a joystick (cursor keys in this case, I don't have an actual spectrum), how would I do that?
Re: displaying and animating UDG's on the spectrum
Posted: Mon Jul 04, 2022 12:36 am
by XavSnap
Hi Crayon,
Try to code a simple ZX81 like basic program based on the "PRIINT AT" command, it will work on the Spectrum.
Ever seen in your previous posts...

Re: displaying and animating UDG's on the spectrum
Posted: Mon Jul 04, 2022 5:21 am
by Crayon21
btw, how do you pronounce xavsnap anyway?
Re: displaying and animating UDG's on the spectrum
Posted: Mon Jul 04, 2022 8:44 am
by dr beep
Crayon21 wrote: ↑Sun Jul 03, 2022 10:21 pm
got the UDG on screen finally but what if I wanted to use a joystick (cursor keys in this case, I don't have an actual spectrum), how would I do that?
You only have to test for the keys 5678 and 0 for fire.
An external cursorjoystick works like that.
Re: displaying and animating UDG's on the spectrum
Posted: Mon Jul 04, 2022 11:31 pm
by XavSnap
Crayon21 wrote: ↑Mon Jul 04, 2022 5:21 am
btw, how do you pronounce xavsnap anyway?
You kill me ! ... xavsnap with the french accent !
Re: displaying and animating UDG's on the spectrum
Posted: Tue Jul 05, 2022 2:59 am
by Crayon21
zes-net?