Author Topic: Ascii Scroller  (Read 15431 times)

0 Members and 1 Guest are viewing this topic.

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Ascii Scroller
« on: December 09, 2008 »
thanx man ;D

the least i could do is thank the people who helped me :D

EDIT: i managed to set the motion i wanted and add color to the letters.

what i can't find how to do it is to show all the letters in the scroller (it only shows some letters), and to make it show from right to left.

the code i'm using.

Code: [Select]
'' To keep our letters in memory
Dim as string LettersToScroll(50) => {"H","o","!"," ","H","o","!"," ","H","o","!"," ","M","e","r","r","y"," ","C","h","r","i","s","t","m","a","s"}


'' To keep our letters position somewhere :
Dim as single LettersX(12), LettersY(12)


'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 10
   
    LettersX(i) = i*15
    LettersY(i) = 480  '' middle screen
   
next

Screenres 640,480,16,2

Do : screenlock : cls

   
    For i as integer = 0 to 12
       
        LettersX(i) += 0.4  ' scroll along X axis
   
        LettersY(i) = 320+70*sin(LettersX(i)/70)   ' Sine Scroll along Y axis (the distance of letters)
       
        Draw String(LettersX(i), LettersY(i)),LettersToScroll(i),rgb(98,39,252)
       
       
        if LettersX(i)>640 then LettersX(i) = 0  '' if a letter is too far on the right, make it start again on the left
       
       
    Next
   
    Screenunlock : sleep 1,1
   
Loop until multikey(&h01)  '' Will quit loop if ESC is pressed



[Edit - This topic was split from "Hello Everyone" by Shockwave. The original topic is locked, please stay on topic here, once the problem is solved and you want to make something else, please create a new topic.]
« Last Edit: December 22, 2008 by Shockwave »


Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #1 on: December 10, 2008 »
/--\
  ||
  ||

bump ::)
« Last Edit: December 21, 2008 by va!n »


Offline Hezad

  • Sponsor
  • Pentium
  • *******
  • Posts: 613
  • Karma: 44
  • I believe .. in Patrick.
    • View Profile
    • Hezad.com Web hosting
Re: Hello everyone :)
« Reply #2 on: December 11, 2008 »
There are more letters in the array, so you must declare more space in the arrays containing position of these letters. Plus, you must handle more letters in your loops :)


replace :
Code: [Select]
'' To keep our letters position somewhere :
Dim as single LettersX(12), LettersY(12)
with
Code: [Select]
Dim as single LettersX(50), LettersY(50)
replace :
Code: [Select]
'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 10
   
    LettersX(i) = i*15
    LettersY(i) = 480  '' middle screen
   
next
with
Code: [Select]
For i as integer = 0 to 50
   
    LettersX(i) = i*15
    LettersY(i) = 480  '' middle screen
   
next

finally, replace :
Code: [Select]
For i as integer = 0 to 12with
Code: [Select]
For i as integer = 0 to 50
Do you see why you need those changes ?

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #3 on: December 11, 2008 »
yeah i got it thanx man ;D , i changed all the others you said and only got it to show up to the letter "M" , and when i tried to change this -> "For i as integer = 0 to 12" , it froze the compiler when compiled but now it works  :updance:

how about making it go the other way? i tried to add this code to make it go from right to left

Code: [Select]
LettersX=LettersX-1
if LettersX<(-len(a)*8) then xText=632

like it was in the other intro but all i got was errors

EDIT: how can i make the scroller read a font and display it? and what type of image must the font be? (.bmp , .png). thanx in advance guys  :D
« Last Edit: December 21, 2008 by va!n »


Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #4 on: December 19, 2008 »
i now have another question  ::)

i'm trying to put some color in this string ->

Code: [Select]
Draw String(43,0)," hello guys "
but when i make it -->

Code: [Select]
Draw String(43,0),rgb(50,50,50)" hello guys "
i get this error -->

Code: [Select]
Compiler output:
C:/Program Files/FreeBASIC/FBIDETEMP.bas(28) error 55: Type mismatch, at parameter 5
Draw String(43,0),rgb(50,50,50)" hello guys "

so my questions is this, can i color the text inside the "Draw String" command?
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #5 on: December 19, 2008 »
Something like this should work mate.

Code: [Select]
COLOR rgb(50,50,50), rgb(0,0,0)
Draw String(43,0)," hello guys "

the freebasic color command takes two arguments the first is the forground color and the second is the background color. you can also use this on circles rectangles etc.

hope this helps
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #6 on: December 19, 2008 »
Something like this should work mate.

Code: [Select]
COLOR rgb(50,50,50), rgb(0,0,0)
Draw String(43,0)," hello guys "

the freebasic color command takes two arguments the first is the forground color and the second is the background color. you can also use this on circles rectangles etc.

hope this helps

yes it does cheers man :cheers:

now my question is this, i have several draw strings in my screen and i tried this

Code: [Select]
COLOR rgb(50,50,50), rgb(0,0,0)
Draw String(43,0)," hello guys "
COLOR rgb(150,150,150), rgb(0,0,0)
Draw String(43,0)," hello guys2 "

but the hello guys2 line doesn't have the color it's supposed do, it has the same color from the first line.

and to be exact i have about 52 draw strings i want to color with different color for each one, is this possible?
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #7 on: December 19, 2008 »
right it should be possible,

the peice of code above draws the text in the same place though which would give ( hello guys )( hello guys2 ) color.

could you maybe post the code that isnt working for you?
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #8 on: December 19, 2008 »
right, this does work ok.

Code: [Select]
SCREEN 19, 32
CLS
COLOR rgb(150,0,0), rgb(0,0,0)
Draw String(43,0)," hello guys "

COLOR rgb(150,150,150), rgb(0,0,0)
Draw String(43,15)," hello guys2 "

Sleep

do you wish for a single line of text to change colors. because that can also be done very simply with variables as your rgb indexes. let me know what your after and ill help.
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #9 on: December 19, 2008 »
yes it works :D :D

thanx man :cheers:

i can't post the source, not untill 1/1/2009  :P

not b/c it's a super secret nuclear eyes only top national sequrity thingie lol :P
but b/c i'm making a "newyeartro" (within my coding limits ::)) for you guys and i don't want you to see it yet ::) :P

the reason i wanted to color every line is b/c it will look like copper (i hope) but it won't move.

and i'm doing it this way b/c i can't make coppers that move yet :stirrer:, and to be precise i can't make any coppers at all :P

the dreamy thing would be to make the strings color up like in the "oracle sinemania" example but without the wave effect, but i can't do that yet.
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #10 on: December 19, 2008 »
cool im glad you got it going mate!

i look forward to seeing it finished. Btw you dont have to do 50 lines of text you can do something like this.

Code: [Select]
SCREEN 19, 32
CLS
Dim As Double DeltaF
Dim As Double R = 0
Dim As Integer Y
DeltaF = 255/(39/2)

For Y = 0 to 39
    COLOR rgb(R,0,0), rgb(0,0,0)
    Draw String(43,Y*14)," hello guys "
   
    R += DeltaF
    If R > 255 Then
        R = 255
        DeltaF = -DeltaF
    EndIf
    If R < 0 Then
        R = 0
        DeltaF = -DeltaF
    EndIf
Next

Sleep

Can you see how that might work mate? Cause if not ill explain
« Last Edit: December 19, 2008 by ninogenio »
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #11 on: December 19, 2008 »
perfect :carrot: :carrot:

exactly was i wanted to do ;D ;D ;D ;D ;D

i allready colored every string lol :P but didn't have the effect i hoped.

how do i change it to this color? -> r125,g146,b242

EDIT: i just applied the code inside the one i have and i get 2 results, note i have a sinescroller there too

result 1, i put the color code before the scroller and i get a black screen with the scroller only

result 2, i put the code adter the scroller and i get all lines in red also flashing :P , and the scroller is just a blue blurry line.

the scroller i'm using.

Code: [Select]
Screenres 640,480,16,2

'' To keep our letters in memory
Dim as string LettersToScroll(12) => {"H","e","l","l","o"," ","W","o","r","l","d"," ","!"}


'' To keep our letters position somewhere :
Dim as single LettersX(12), LettersY(12)


'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 12
   
    LettersX(i) = i*10
    LettersY(i) = 320  '' middle screen
   
next

Do : screenlock : cls
   
    For i as integer = 0 to 12
       
        LettersX(i) += 0.5  ' scroll along X axis
   
        LettersY(i) = 320+10*sin(LettersX(i)/10)   ' Sine Scroll along Y axis
       
        Draw String(LettersX(i), LettersY(i)),LettersToScroll(i)
       
       
        if LettersX(i)>640 then LettersX(i) = 0  '' if a letter is too far on the right, make it start again on the left
       
    Next
   
    Screenunlock : sleep 1,1
   
Loop until multikey(&h01)  '' Will quit loop if ESC is pressed

also how can i make the scroller go backwards? ::)
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #12 on: December 19, 2008 »
For the color do this.

Code: [Select]
' Good old 320x200x8
SCREEN 19, 32
CLS
Dim As Double DeltaFR , DeltaFG , DeltaFB
Dim As Double R = 0 , G = 0 , B = 0
Dim As Integer Y
DeltaFR = 125/(39/2)
DeltaFG = 146/(39/2)
DeltaFB = 242/(39/2)

For Y = 0 to 39
    COLOR rgb(R,G,B), rgb(0,0,0)
    Draw String(43,Y*14)," hello guys "
   
    R += DeltaFR
    G += DeltaFG
    B += DeltaFB

    If R > 125 Then
        R = 125
        DeltaFR = -DeltaFR
    EndIf
    If R < 0 Then
        R = 0
        DeltaFR = -DeltaFR
    EndIf
    If G > 146 Then
        G = 146
        DeltaFG = -DeltaFG
    EndIf
    If G < 0 Then
        G = 0
        DeltaFG = -DeltaFG
    EndIf
    If B > 242 Then
        B = 242
        DeltaFB = -DeltaFB
    EndIf
    If B < 0 Then
        B = 0
        DeltaFB = -DeltaFB
    EndIf
Next

Sleep

ill have a look at the rest for you later as im just going out.

Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #13 on: December 19, 2008 »
okies man ;) have fun :D

EDIT: here is the complete code i'm using.

i left in the starting strings and removed the rest :D

Code: [Select]
Screenres 640,480,16,2

#Include Once "tinyptc.bi"
#include "windows.bi"
'#include "ufmod.bi"
'#include "tune.bas"
       'Dim hWave As HWAVEOUT
       'hWave = uFMOD_PlaySong(@Music(0),31009,XM_MEMORY)
'' To keep our letters in memory
Dim as string LettersToScroll(50) => {"H","a","p","p","y"," ","N","e","w"," ","Y","e","a","r"," ","2","0","0","9","!","!"," "," "," "," "," "," "}
dim a as string

'' To keep our letters position somewhere :
Dim as single LettersX(50), LettersY(50)


'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 50
   
    LettersX(i) = i*15
    LettersY(i) = 480  '' middle screen
   
next

''''Screenres 640,480,16,2
'bikerboy
Do : screenlock : cls
Dim As Double DeltaFR , DeltaFG , DeltaFB
Dim As Double R = 0 , G = 0 , B = 0
Dim As Integer Y
DeltaFR = 125/(39/2)
DeltaFG = 146/(39/2)
DeltaFB = 242/(39/2)

For Y = 0 to 39
   
COLOR rgb(R,G,B), rgb(0,0,0)
Draw String(43,0),"     ...       _     _ _             _                      ...     "
Draw String(43,10),"    ( oo)     | |   (_) |           | |                    (- o)    "
Draw String(43,20),"ooO--(_)--Ooo-| |__  _| | _____ _ __| |__   ___  _   _ ooO--(_)--Ooo"
Draw String(43,30),"              | '_ \| | |/ / _ \ '__| '_ \ / _ \| | | |             "
Draw String(43,40),"              | |_) | |   <  __/ |  | |_) | (_) | |_| |             "
Draw String(43,50),"              |_.__/|_|_|\_\___|_|  |_.__/ \___/ \__, |             "
Draw String(43,60),"                                                  __/ |             "
Draw String(43,70),"              _________________________________  |___/              "
'
'DBF url
Draw String(58,65),"             @ http://www.dbfinteractive.com"

'the scroller part
    For i as integer = 0 to 50
       
        LettersX(i) += 0.6  ' scroll along X axis
       
        LettersY(i) = 330+10*sin(LettersX(i)/10)   ' Sine Scroll along Y axis (the distance of letters)
       
        Draw String(LettersX(i), LettersY(i)),LettersToScroll(i),rgb(98,39,252)
       
       
        if LettersX(i)>640 then LettersX(i) = -0  '' if a letter is too far on the right, make it start again on the left
       
       
   
    Next
   
    Screenunlock : sleep 1,1
   
    'color part
    R += DeltaFR
    G += DeltaFG
    B += DeltaFB

    If R > 125 Then
        R = 125
        DeltaFR = -DeltaFR
    EndIf
    If R < 0 Then
        R = 0
        DeltaFR = -DeltaFR
    EndIf
    If G > 146 Then
        G = 146
        DeltaFG = -DeltaFG
    EndIf
    If G < 0 Then
        G = 0
        DeltaFG = -DeltaFG
    EndIf
    If B > 242 Then
        B = 242
        DeltaFB = -DeltaFB
    EndIf
    If B < 0 Then
        B = 0
        DeltaFB = -DeltaFB
    EndIf
Next
   
Loop until multikey(&h01)  '' Will quit loop if ESC is pressed

now that i look the code again, i think it only supports a single line of text, i have many lines.

but the flash must have something to do with the scroller i think.
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #14 on: December 20, 2008 »
sorry for the wait Biker boy iv got some hang over from last night ;D

is it something like this you were after.

Code: [Select]
Screenres 640,480,16,2

#Include Once "tinyptc.bi"
#include "windows.bi"
'#include "ufmod.bi"
'#include "tune.bas"
       'Dim hWave As HWAVEOUT
       'hWave = uFMOD_PlaySong(@Music(0),31009,XM_MEMORY)
'' To keep our letters in memory
Dim as string LettersToScroll(50) => {"H","a","p","p","y"," ","N","e","w"," ","Y","e","a","r"," ","2","0","0","9","!","!"," "," "," "," "," "," "}
dim a as string

'' To keep our letters position somewhere :
Dim as single LettersX(50), LettersY(50)


'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 50
   
    LettersX(i) = i*15
    LettersY(i) = 480  '' middle screen
   
next

''''Screenres 640,480,16,2
'bikerboy
Dim Shared As String Message(9)
Message(1) = "     ...       _     _ _             _                      ...     "
Message(2) = "    ( oo)     | |   (_) |           | |                    (- o)    "
Message(3) = "ooO--(_)--Ooo-| |__  _| | _____ _ __| |__   ___  _   _ ooO--(_)--Ooo"
Message(4) = "              | '_ \| | |/ / _ \ '__| '_ \ / _ \| | | |             "
Message(5) = "              | |_) | |   <  __/ |  | |_) | (_) | |_| |             "
Message(6) = "              |_.__/|_|_|\_\___|_|  |_.__/ \___/ \__, |             "
Message(7) = "                                                  __/ |             "
Message(8) = "              _________________________________  |___/              "

Do : screenlock
   
    Dim As Double DeltaFR , DeltaFG , DeltaFB
    Dim As Double R = 0 , G = 0 , B = 0
    Dim As Integer Y
    DeltaFR = 125/(8/2)
    DeltaFG = 146/(8/2)
    DeltaFB = 242/(8/2)

    For Y = 0 to 8
   
        COLOR rgb(R,G,B), rgb(0,0,0)
        Draw String(43,Y*10),Message(Y)
        'color part
        R += DeltaFR
        G += DeltaFG
        B += DeltaFB

        If R > 125 Then
            R = 125
            DeltaFR = -DeltaFR
        EndIf
        If R < 0 Then
            R = 0
            DeltaFR = -DeltaFR
        EndIf
        If G > 146 Then
            G = 146
            DeltaFG = -DeltaFG
        EndIf
        If G < 0 Then
            G = 0
            DeltaFG = -DeltaFG
        EndIf
        If B > 242 Then
            B = 242
            DeltaFB = -DeltaFB
        EndIf
        If B < 0 Then
            B = 0
            DeltaFB = -DeltaFB
        EndIf
    Next
   
    'DBF url
    Color RGB(0,0,255),RGB(0,0,0)
    Draw String(58,75),"             @ http://www.dbfinteractive.com"
       
    'the scroller part
    For i as integer = 0 to 50
       
        LettersX(i) += 0.6  ' scroll along X axis
       
        LettersY(i) = 330+10*sin(LettersX(i)/10)   ' Sine Scroll along Y axis (the distance of letters)
       
        Draw String(LettersX(i), LettersY(i)),LettersToScroll(i),rgb(98,39,252)
       
       
        if LettersX(i)>640 then LettersX(i) = -0  '' if a letter is too far on the right, make it start again on the left
       
       
   
    Next
   
    Screenunlock : sleep 1,1
    cls

   
Loop until multikey(&h01)  '' Will quit loop if ESC is pressed

Challenge Trophies Won:

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Hello everyone :)
« Reply #15 on: December 20, 2008 »
Nice one ninogenio! ;) especially with an hangover! lol!

Obviously like that the scroller runs very fast . . . but just by changing the line

LettersX(i) += 0.6

to something like

LettersX(i) += 0.025

it is readable . . .

I like this!

DrewPee
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #16 on: December 20, 2008 »
sorry for the wait Biker boy iv got some hang over from last night ;D

is it something like this you were after.

no worries mate i'm in no rush :D

it's exactly what i was looking for :goodpost: :goodpost:

a quick question, should i change this -> Dim Shared As String Message(9) , to the number of lines i have? i have about 52-53 text lines, should i make it for example ->Dim Shared As String Message(53) ?

@DrewPee

yup i'll slow it down ;)

EDIT: ok figured that out, changed For Y = 0 to 55 and now it displays all text lines, but now a few more questions has risen :P

Q1 : can i somehow center the text to the screen?
Q2 : what should i change to make it a bit brighter? some text lines are not visible at all ::) EDIT: discard that one i've found it ;D

it's all perfect except that some text is off screen from bottom and right side, can i somehow add something like "Message(1),(58,75), = "insert text here". ?

lol EDIT: again :P never mind the above i found it, changed Draw "String(3,Y*9),Message(Y)", and everything fits on screen ok now :clap: now i need to add some spaces to some lines to make it look better
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #17 on: December 20, 2008 »
right now we get on to the fun part, understanding what i have done so you can change it to suit yourself ;).

firstly lets break open the copper part to see how it works and how it can be changed to suit more lines of text.

lets look at the delta values to see what all the numbers mean.

DeltaFR = 125/(39/2)

right what essentially we want to do is at the centre of our text lines we want the r value to hit 125 so what we need is some small factor we can add on to R = 0 each frame so that when we render the centre line of text R will equal 125.

So we use fractions or a delta factor as us coders like to call it to come up with a delta factor for red i did this in my original example DeltaFR = R / ( NoTextLines / 2 ) Try that on a calculator and multiply the Delta Factor be half the number of text lines it should give you a value of R. The exact same principle applys to G and B

Can you see how these calculations should be changed to achive diffrent colors and for diffrent numbers of text lines?

Now For This part

    R += DeltaFR
    G += DeltaFG
    B += DeltaFB

    If R > 125 Then
        R = 125
        DeltaFR = -DeltaFR
    EndIf
    If R < 0 Then
        R = 0
        DeltaFR = -DeltaFR
    EndIf
    If G > 146 Then
        G = 146
        DeltaFG = -DeltaFG
    EndIf
    If G < 0 Then
        G = 0
        DeltaFG = -DeltaFG
    EndIf
    If B > 242 Then
        B = 242
        DeltaFB = -DeltaFB
    EndIf
    If B < 0 Then
        B = 0
        DeltaFB = -DeltaFB
    EndIf

now what i do is add our color delta factors onto r = 0 g = 0 b = 0 inside the for loop so that half way through the for loop our colors will equal 125,146,242 now when this point is reached we dont want to keep adding the delta factor on as it wouldn't be very copper barish so what i do is reverse the delta sign like DeltaFR = -DeltaFR now when we add this onto R it will start to take away from it so that when the for loop is finished r will equal 0 again.

does that make sense ok?

now onto moving the text around.

 Draw String(43,Y*10),Message(Y)

just add an offset to y like so 10+Y*10 you might need to play about with the offset to get it just right. i hope this helps.
« Last Edit: December 21, 2008 by ninogenio »
Challenge Trophies Won:

Offline bikerboy

  • Amiga 1200
  • ****
  • Posts: 349
  • Karma: 12
    • View Profile
Re: Hello everyone :)
« Reply #18 on: December 21, 2008 »
yup it helps a lot ;D :cheers: :cheers:

i think you guys need to assemble and write the DBF tutorial  :P :P

i attached an image of how it looks now :D

Ps. my biggest problem ever was maths ...  ::)

Ps2. i've tried to reverse the scroller to run from right to left instead of left to right and my best effort was to pause it, disapear it, and it appear from the center of the screen.

any ideas of how i can make it go backwards?
« Last Edit: December 21, 2008 by va!n »


Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Hello everyone :)
« Reply #19 on: December 21, 2008 »
i really think your doing excellently bikerboy keep pluging away and you will get there.

how about this for making it go backwords notice i have added an offset to the scroller here.
LettersX(i) = 640+i*15

and iv reversed the signs here
        LettersX(i) -= 0.6  ' scroll along X axis
       
        LettersY(i) = 330-10*sin(LettersX(i)/10)   ' Sine Scroll along Y axis (the distance of letters)
and the if check
        if LettersX(i)<0 then LettersX(i) = 640  '' if a letter is too far on the left, make it start again on the left

Code: [Select]
#include "windows.bi"
'#include "ufmod.bi"
'#include "tune.bas"
       'Dim hWave As HWAVEOUT
       'hWave = uFMOD_PlaySong(@Music(0),31009,XM_MEMORY)
'' To keep our letters in memory
Dim as string LettersToScroll(50) => {"H","a","p","p","y"," ","N","e","w"," ","Y","e","a","r"," ","2","0","0","9","!","!"," "," "," "," "," "," "}
dim a as string

'' To keep our letters position somewhere :
Dim as single LettersX(50), LettersY(50)


'' init Letters position (I assume a letter width and Height is 10)
For i as integer = 0 to 50
   
    LettersX(i) = 640+i*15
    LettersY(i) = 480  '' middle screen
   
next

''''Screenres 640,480,16,2
'bikerboy
Dim Shared As String Message(9)
Message(1) = "     ...       _     _ _             _                      ...     "
Message(2) = "    ( oo)     | |   (_) |           | |                    (- o)    "
Message(3) = "ooO--(_)--Ooo-| |__  _| | _____ _ __| |__   ___  _   _ ooO--(_)--Ooo"
Message(4) = "              | '_ \| | |/ / _ \ '__| '_ \ / _ \| | | |             "
Message(5) = "              | |_) | |   <  __/ |  | |_) | (_) | |_| |             "
Message(6) = "              |_.__/|_|_|\_\___|_|  |_.__/ \___/ \__, |             "
Message(7) = "                                                  __/ |             "
Message(8) = "              _________________________________  |___/              "

Do : screenlock
   
    Dim As Double DeltaFR , DeltaFG , DeltaFB
    Dim As Double R = 0 , G = 0 , B = 0
    Dim As Integer Y
    DeltaFR = 125/(8/2)
    DeltaFG = 146/(8/2)
    DeltaFB = 242/(8/2)

    For Y = 0 to 8
   
        COLOR rgb(R,G,B), rgb(0,0,0)
        Draw String(43,Y*10),Message(Y)
        'color part
        R += DeltaFR
        G += DeltaFG
        B += DeltaFB

        If R > 125 Then
            R = 125
            DeltaFR = -DeltaFR
        EndIf
        If R < 0 Then
            R = 0
            DeltaFR = -DeltaFR
        EndIf
        If G > 146 Then
            G = 146
            DeltaFG = -DeltaFG
        EndIf
        If G < 0 Then
            G = 0
            DeltaFG = -DeltaFG
        EndIf
        If B > 242 Then
            B = 242
            DeltaFB = -DeltaFB
        EndIf
        If B < 0 Then
            B = 0
            DeltaFB = -DeltaFB
        EndIf
    Next
   
    'DBF url
    Color RGB(0,0,255),RGB(0,0,0)
    Draw String(58,75),"             @ http://www.dbfinteractive.com"
       
    'the scroller part
    For i as integer = 0 to 50
       
        LettersX(i) -= 0.6  ' scroll along X axis
       
        LettersY(i) = 330-10*sin(LettersX(i)/10)   ' Sine Scroll along Y axis (the distance of letters)
       
        Draw String(LettersX(i), LettersY(i)),LettersToScroll(i),rgb(98,39,252)
       
       
        if LettersX(i)<0 then LettersX(i) = 640  '' if a letter is too far on the right, make it start again on the left
       
       
   
    Next
   
    Screenunlock : sleep 1,1
    cls

   
Loop until multikey(&h01)  '' Will quit loop if ESC is pressed

does that help?
Challenge Trophies Won: