Author Topic: [Locomotive Basic] a SImple Intro DEMO with Fade  (Read 589 times)

0 Members and 1 Guest are viewing this topic.

Offline Fabrizio Radica

  • Supporter
  • CPC664
  • *
  • Posts: 135
  • Country: it
  • Amiga and CPC6128 User
    • Retroacademy
  • Liked: 128
  • Likes Given: 122
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!
Code: [Select]
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
Amstrad CPC6128 <3
http://www.facebook.com/groups/retroacademy/
Retroacademy.it - retrocomputing, retrogame anni &#039;70, &#039;80, &#039;90
Retroacademy.it - retrocomputing, retrogame anni '70, '80, '90

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.299
  • Country: au
    • index.php?action=treasury
  • Liked: 955
  • Likes Given: 1063
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #1 on: 12:28, 28 June 19 »
Very nice.
The colour fading is very effective.
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.721
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 957
  • Likes Given: 1676
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #2 on: 15: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.


Code: [Select]

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

Offline Fabrizio Radica

  • Supporter
  • CPC664
  • *
  • Posts: 135
  • Country: it
  • Amiga and CPC6128 User
    • Retroacademy
  • Liked: 128
  • Likes Given: 122
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #3 on: 15:45, 28 June 19 »
Good idea for optimize!


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.


Code: [Select]

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
Amstrad CPC6128 <3
http://www.facebook.com/groups/retroacademy/
Retroacademy.it - retrocomputing, retrogame anni &#039;70, &#039;80, &#039;90
Retroacademy.it - retrocomputing, retrogame anni '70, '80, '90

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.127
  • Country: gr
    • Parts from the past.
  • Liked: 619
  • Likes Given: 1587
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #4 on: 15: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.

Offline Fabrizio Radica

  • Supporter
  • CPC664
  • *
  • Posts: 135
  • Country: it
  • Amiga and CPC6128 User
    • Retroacademy
  • Liked: 128
  • Likes Given: 122
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #5 on: 22:05, 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 :)
Amstrad CPC6128 <3
http://www.facebook.com/groups/retroacademy/
Retroacademy.it - retrocomputing, retrogame anni &#039;70, &#039;80, &#039;90
Retroacademy.it - retrocomputing, retrogame anni '70, '80, '90

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 1.127
  • Country: gr
    • Parts from the past.
  • Liked: 619
  • Likes Given: 1587
Re: [Locomotive Basic] a SImple Intro DEMO with Fade
« Reply #6 on: 01:46, 28 October 19 »
Thank you.


Greetings from ArisLab  ;D