CPCWiki forum

General Category => Programming => Topic started by: Fabrizio Radica on 17:14, 03 July 19

Title: [Locomotive Basic] - Scrolling
Post by: Fabrizio Radica on 17:14, 03 July 19
Hi :)

I've made a simple "Multiple FAST" scrolling in Locomotive Basic :)

10 defint x,j,y,h,u,k,o:mode 0:border 0:ink 0,0:ink 1,26:x=1:x2=1:y=5:symbol after 250
15 symbol 255,1,54,78,32,67,92,88,1
20 tag:move k,180-y:print " "+chr$(249);:k=6+k mod 320:move u,200-y:print " "+chr$(249);:u=8+u mod 320
30 h=31+(h mod 320):move x+h,100-y:print chr$(255);:
40 move j+h,300-y:print chr$(255);:tagoff:
50 locate 12-o,y:print chr$(255)+" ";:o=1+o mod 10
60 goto 20
not optimized...
Title: Re: [Locomotive Basic] - Scrolling
Post by: AMSDOS on 10:56, 04 July 19
Interesting.


I used INK Palette Switching to create the Illusion of Horizontal Movement which later on I found others were doing the same with Locomotive BASIC. With the scenery in place line 220 sets between the alternating colours and line 230 regulates the SPEED between the alternating colours. I found going any smaller than SPEED INK 3,3 and it's too fast.




100 MODE 0:INK 2,13:INK 3,3:INK 4,0:INK 5,0:DEFINT a-z
110 SYMBOL 255,126,131,129,129,139,85,170,84
120 SYMBOL 254,0,124,126,126,116,0,0,0
130 i1=4:i2=2:x=6:y=7
140 WHILE x<15
150   i=i1
160   GOSUB 1000
170   x=x+1
180   i=i2
190   GOSUB 1000
200   x=x+1
210 WEND
220 INK 2,13,0:INK 3,3,0:INK 4,0,13:INK 5,0,3
230 SPEED INK 5,5
240 PEN 1:END
1000 PRINT CHR$(22)+CHR$(1);
1010 FOR c=255 TO 254 STEP -1
1020   LOCATE x,y
1030   PEN i
1040   PRINT CHR$(c);
1050   i=i+1
1060 NEXT c
1070 PRINT CHR$(22)+CHR$(0)
1080 RETURN
Powered by SMFPacks Menu Editor Mod