News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Fabrizio Radica

[Locomotive Basic] a SImple Intro DEMO with Fade

Started by Fabrizio Radica, 08:16, 28 June 19

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Fabrizio Radica

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


ervin

Very nice.
The colour fading is very effective.

AMSDOS

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
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Fabrizio Radica

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


VincentGR

OK @Fabrizio Radica this is awesome.


Can I use it in an intro I'm planning to do?
I will include your name.

Fabrizio Radica

Quote from: VincentGR on 14:59, 27 October 19
OK @Fabrizio Radica this is awesome.


Can I use it in an intro I'm planning to do?
I will include your name.
Yes, of course :)

VincentGR


Powered by SMFPacks Menu Editor Mod