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

Username:   Password: 
 RegisterRegister   
 Help Need It Fast
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
firex2249




PostPosted: Fri Jan 18, 2008 9:35 pm   Post subject: Help Need It Fast

ok i found a way to drag words but how can i display my title at the time as the drag so they word together and also my exit button will work, plz can u help

put " Alphabetical Order Game"
put "*To exit the game type:stop*"

put "List of words:"

var mx1old, my1old : int := 0
var mx1, my1, mb1 : int := 0
var wordx1, wordy1 : int
loop
Mouse.Where (mx1, my1, mb1)
if (not mx1 = mx1old) and (not my1 = my1old) and mb1 > 0 then
cls
locatexy (min (max (mx1, 0), maxx), min (max (my1, 0), maxy))
put "Noob"
end if
mx1old := mx1
my1old := my1

end loop

drawbox (50, 50, 125, 125, blue)
locatexy (75, 82)
put "EXIT" ..

var x, y, button : int

loop
mousewhere (x, y, button)
% If button the is clicked, exits the program.
exit when 50 <= x and x <= 125 and 50 <= y and y <= 125 and button = 1
end loop
Sponsor
Sponsor
Sponsor
sponsor
ericfourfour




PostPosted: Fri Jan 18, 2008 10:57 pm   Post subject: RE:Help Need It Fast

Try and combine everything into one loop. It is easy to structure it this way:

Get input (Mouse.Where)
Think (exit condition then do calculations)
Render (clear screen then put and draw)
Flip backbuffer (View.Update if needed)
Limit fps (Time.Delay or delay)
firex2249




PostPosted: Fri Jan 18, 2008 11:04 pm   Post subject: Re: RE:Help Need It Fast

ericfourfour @ Fri Jan 18, 2008 10:57 pm wrote:
Try and combine everything into one loop. It is easy to structure it this way:

Get input (Mouse.Where)
Think (exit condition then do calculations)
Render (clear screen then put and draw)
Flip backbuffer (View.Update if needed)
Limit fps (Time.Delay or delay)


it didnt work is there a way to put more than 1 word at the sametime cause this is what my project says:

You have been hired by the grade 5 English teacher to test a student's ability to put 5 words in alphabetical order. Five randoms words are displayed vertically on the left side of the screen with 5 empty vertical spaces on the right. The students selects each word and moves it to right side of the screen placing it correctly in order. If the words are in correct alphabetical order, a green LED flashes on a corresponding peripheral to indicate the entry is correct. If not, a red LED flashes.
ericfourfour




PostPosted: Sat Jan 19, 2008 10:58 am   Post subject: RE:Help Need It Fast

Structure you loop the way I said. In the part where you do the calculations, you need to calculate where everything is going to be. Then draw it wherever you calculated.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: