Why can't i get character inside this code
Author |
Message |
hello123
|
Posted: Sun Jan 13, 2008 8:33 pm Post subject: Why can't i get character inside this code |
|
|
import GUI
var startGameButton, goodByeButton : int
var pictureID : int
var picHeight, picWidth : int
var key : string (1)
var wrd : real
setscreen ("graphics:640;480")
setscreen ("nocursor")
setscreen ("noecho")
procedure title
locate (1, 30)
put "Let's Play Hide N Seek"
colourback (white)
end title
procedure background
drawfillbox (0, 0, 640, 500, 7)
end background
procedure displayPic
pictureID := Pic.FileNew ("das_keyboard_lrg.jpg")
picHeight := Pic.Height (pictureID)
picWidth := Pic.Width (pictureID)
Pic.Draw (pictureID, 0, 0, picMerge)
getch (key)
end displayPic
procedure mainMenu
GUI.Show (startGameButton)
GUI.Show (goodByeButton)
loop
exit when
GUI.ProcessEvent
end loop
end mainMenu
procedure goodBye
cls
locate (14, 30)
put "Thanks for playing"
locate (15, 30)
put " you are now exiting"
loop
exit
end loop
end goodBye
procedure display
locate (5, 1)
put "Enter your first number:"
get wrd
end display
procedure StartGame
cls
locate (14, 30)
%displayPic
display
end StartGame
procedure introduction
title
locate (5, 1)
put
"Welcome all.This is a hide and seek game. The objective of this game is to find the hidden smilely face underneath the computer equipment or to name all ten computer equipment on the screen. Have Fun!"
end introduction
introduction
%Buttons
startGameButton := GUI.CreateButtonFull (320, 100, 100, "Start Game", StartGame, 0, '^I', false)
goodByeButton := GUI.CreateButtonFull (100, 100, 100, "Exit", goodBye, 0, '^I', false)
background
introduction
mainMenu
StartGame
goodBye |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
hello123
|
Posted: Sun Jan 13, 2008 8:38 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
why can't i get character inside the start game part |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Jan 13, 2008 9:02 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
because your code is stuck in the GUI.ProcessEvents loop. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
hello123
|
Posted: Sun Jan 13, 2008 9:07 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
how do u reccomend i fix this problem |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Jan 13, 2008 9:11 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
Call GUI.Quit to disable GUI and exit the loop. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
LaZ3R
|
Posted: Sun Jan 13, 2008 9:49 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
How about this: DON'T USE GUI. For the love of god, why are all of the students in my school and others schools so tempted to use GUI?
Much easier to design your own menu's and work from that... |
|
|
|
|
![](images/spacer.gif) |
hello123
|
Posted: Sun Jan 13, 2008 10:02 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
that may b so but the use of GUI is required in this ISU accordin to my teacher |
|
|
|
|
![](images/spacer.gif) |
LaZ3R
|
Posted: Sun Jan 13, 2008 10:09 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
Wow,that's pretty lame then. :p |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Jan 13, 2008 10:13 pm Post subject: RE:Why can\'t i get character inside this code |
|
|
LaZ3R - you've got to realize that this teacher's entire class is on here. It would be nice for the teacher to register and participate as well though. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
Gooie
|
Posted: Mon Jan 14, 2008 12:54 am Post subject: Re: Why can't i get character inside this code |
|
|
I agree LaZ3R, GUI only cause problems. I used it once had one problem and, I gave up on it. Plus, making your own menu's is more fun. I think a teacher should be joyed to see that a student wants to do it themselves. |
|
|
|
|
![](images/spacer.gif) |
Sean
![](http://compsci.ca/v3/uploads/user_avatars/47413941748406f441f83e.png)
|
Posted: Mon Jan 14, 2008 7:39 am Post subject: Re: Why can't i get character inside this code |
|
|
Turing: |
setscreen ("graphics:640;480,nocursor,neecho")
|
You can do your setscreen in one line, not needing three like you had, just add commas in.
Saves you from drawing a pointless square.
Turing: |
procedure goodBye
cls
locate (14, 30)
put "Thanks for playing"
locate (15, 30)
put " you are now exiting"
loop
exit
end loop
end goodBye
|
What is the point in the loop here, really doesn't look like it is doing anything.. |
|
|
|
|
![](images/spacer.gif) |
LaZ3R
|
Posted: Mon Jan 14, 2008 7:04 pm Post subject: Re: RE:Why can\'t i get character inside this code |
|
|
Tony @ Sun Jan 13, 2008 10:13 pm wrote: LaZ3R - you've got to realize that this teacher's entire class is on here. It would be nice for the teacher to register and participate as well though.
I'm fully aware of that :p
That doesn't change my viewpoint on GUI sucking so much however =) |
|
|
|
|
![](images/spacer.gif) |
|
|