Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need Some Calrification On Saving
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mazer




PostPosted: Fri Jul 25, 2003 3:58 pm   Post subject: (No subject)

i think he's talking about the first bit of code for showing the story of the game.

code:

colourback (7)
cls
View.Set ("offscreenonly")

var fs : int
var keybuffer : string (1)
var lines : array 1 .. 6 of string
var font := Font.New ("Garamond:16:bold")

open : fs, "story.txt", get

loop
    for i : 1 .. 6
        exit when eof (fs)
        % edit on next line
        get : fs, lines (i) :*
        for decreasing j : 31 .. 16
            Font.Draw (lines (i), maxx div 2 - Font.Width (lines (i)) div 2, maxy div 6 * i, font, j)
            delay (20)
            View.Update
        end for
    end for
    for i : 1 .. 6
        lines (i) := ""
    end for

    loop
        exit when hasch
    end loop
    getch (keybuffer)
    cls
end loop


sorry, forgot about basic string input. Embarassed
since there are spaces and you want the whole line, you need to put :* after the get part
Sponsor
Sponsor
Sponsor
sponsor
Archi




PostPosted: Fri Jul 25, 2003 5:27 pm   Post subject: (No subject)

Sweet, that works.. Now i gotta figure out how to make it so that it will exit that routine after the user presses a key.
AsianSensation




PostPosted: Fri Jul 25, 2003 8:47 pm   Post subject: (No subject)

code:
var key : string (1)

loop
    if hasch then
        getch (key)
        exit
    end if
end loop


this will do it
Archi




PostPosted: Fri Jul 25, 2003 11:10 pm   Post subject: (No subject)

Got it to work a different way. Now it doesn't want to end the loop when I want it to. In order for it to continue processing I have to minimize the window and bring it back up...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: