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

Username:   Password: 
 RegisterRegister   
 ISP help - with my intro screen please!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
13ennett




PostPosted: Fri Dec 15, 2006 10:52 am   Post subject: ISP help - with my intro screen please!!!

Hey evrybody Very Happy ..how it going? anyways i was wondering if anyone could help me with an intro screen I am making for my GSP. I can't figure out how to get "Press any key to contiune" to wor. Heres my sameful attempt at it for someone to tellme what im doing wrong.

code:

setscreen("graphics:vga")
setscreen("nocursor")
colourback(black)cls
var mypic :int := Pic.FileNew ("F1 LOGO.jpg")
var x,i,font1 :int

font1 := Font.New ("CopprplGoth Bd BT:8:italic")
x := maxx

loop
Pic.Draw (mypic, x, 200, picCopy)
x -= 1
exit when x = 250
end loop
delay(1000)
Font.Draw ("The Game", 240, 210, font1, white)
colour(0)
locate(16,26)
delay(2000)
var chars : array char of boolean
put "Press any key to continue "

 Input.KeyDown (chars)
           loop
            if chars (KEY_ENTER) then
            exit   
           
end if
  end loop         


allhelp would be appreciated...and yesi do realise i am a total n00b Embarassed
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Dec 15, 2006 11:48 am   Post subject: (No subject)

you need to have that Input.KeyDown() inside the loop, else you never check for the updated keyboard status Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
uberwalla




PostPosted: Fri Dec 15, 2006 5:24 pm   Post subject: (No subject)

yes as he said use input.keydown IN the loop. but as you have it, it only works for the enter key.

to use it for any key simply just use the getch command.

basically all you have to do is declare a variable in your program like this:

var ch :string (1)

then you simply call getch:

getch (ch)

which all it does is wait til you press any key to continue on with your prog.
iamcow




PostPosted: Sat Dec 16, 2006 3:35 pm   Post subject: (No subject)

...or you can just use Input.Pause. This pauses the program until a button is pressed
uberwalla




PostPosted: Sat Dec 16, 2006 6:40 pm   Post subject: (No subject)

aha true. i never thought of that one Razz i could use that in some of my programs. lol . thx Cool
13ennett




PostPosted: Sun Dec 17, 2006 8:11 pm   Post subject: (No subject)

sweet thanks for all the help Razz
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 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: