Posted: 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.
since there are spaces and you want the whole line, you need to put :* after the get part
Sponsor Sponsor
Archi
Posted: 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
Posted: 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
Posted: 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...