CPCWiki forum

General Category => Programming => Topic started by: Fabrizio Radica on 08:16, 28 June 19

Title: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: Fabrizio Radica on 08:16, 28 June 19
Hi Forum :)I've made (for all) a simple intro demo.
Not optimized only for for didactic purposes.On the web, we have very few BASIC sources for our CPC :(

Happy conding!10 cls:border 0:ink 0,0:ink 1,0:mxdim=10:dim txt$(mxdim):a=1
15 txt$[1]="In 2019"
16 txt$[2]="a"
18 txt$[3]="Locomotive Basic"
20 txt$[4]="Intro"
21 txt$[5]="Greetings"
22 txt$[6]="RamJam"
23 txt$[7]="Hedgehog"
24 txt$[8]="CPC Wiki Forum"
25 txt$[9]="and"
27 txt$[10]="the Best Computer Ever Made"
28 env 1,10,1,50

100 for l=1 to mxdim
120 locate 20-len(txt$[l])/2,10:print txt$[l]
140 restore 2000:CALL &BD19:gosub 1000
150 next
160 ink 1,26
200 end

1000 while a<>0
1030 read a:ink 1,a:env 1,50,2,10:sound 1,a*10,5,a/2:CALL &BD19
1035 for w=1 to 32:next
1040 wend
1048 cls:a=1:for w=1 to 1000:next
1050 return


2000 data 1,3,13,12,24,24,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,25,24,12,13,3,1,0

Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: ervin on 10:28, 28 June 19
Very nice.
The colour fading is very effective.
Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: AMSDOS on 13:10, 28 June 19
It's also possible to create a Fade In/Out effect through a String Series, so the Data is stored into a String and gets accessed through the ASC(MID$(a$,p,1)) function. The p variable Points to the start of the string and is incremented along the way. The ASC converts it back to it's ASCII numeric value so to get the right values (for the INK) it is subtracted by 64 to return values between 0 and 26.




10 a$="ACMLXXZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZYXLMCA@"
100 MODE 1:p=1:LOCATE 17,10:PRINT"Hello!"
110 GOSUB 1000
120 GOTO 100
1000 WHILE a<>0
1010   a=ASC(MID$(a$,p,1))-64:INK 1,a:CALL &BD19:p=p+1
1020   FOR w=1 TO 32:NEXT
1030 WEND
1040 CLS:a=1:FOR w=1 TO 1000:NEXT
1050 RETURN
Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: Fabrizio Radica on 13:45, 28 June 19
Good idea for optimize!


Quote from: AMSDOS on 13:10, 28 June 19It's also possible to create a Fade In/Out effect through a String Series, so the Data is stored into a String and gets accessed through the ASC(MID$(a$,p,1)) function. The p variable Points to the start of the string and is incremented along the way. The ASC converts it back to it's ASCII numeric value so to get the right values (for the INK) it is subtracted by 64 to return values between 0 and 26.




10 a$="ACMLXXZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZYXLMCA@"
100 MODE 1:p=1:LOCATE 17,10:PRINT"Hello!"
110 GOSUB 1000
120 GOTO 100
1000 WHILE a<>0
1010   a=ASC(MID$(a$,p,1))-64:INK 1,a:CALL &BD19:p=p+1
1020   FOR w=1 TO 32:NEXT
1030 WEND
1040 CLS:a=1:FOR w=1 TO 1000:NEXT
1050 RETURN

Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: VincentGR on 14:59, 27 October 19
OK @Fabrizio Radica (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1837) this is awesome.


Can I use it in an intro I'm planning to do?
I will include your name.
Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: Fabrizio Radica on 21:05, 27 October 19
Quote from: VincentGR on 14:59, 27 October 19
OK @Fabrizio Radica (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1837) this is awesome.


Can I use it in an intro I'm planning to do?
I will include your name.
Yes, of course :)
Title: Re: [Locomotive Basic] a SImple Intro DEMO with Fade
Post by: VincentGR on 00:46, 28 October 19
Thank you.


Greetings from ArisLab  ;D
Powered by SMFPacks Menu Editor Mod