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

Username:   Password: 
 RegisterRegister   
 Screen Size??
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Archi




PostPosted: Tue Jun 24, 2003 3:29 pm   Post subject: Screen Size??

I have my screen set-up like this:
setscreen ("graphics:800;600").

Now, I'm using a box to get the limitations for my explore window. That works like I want. The only problem I am having is when it comes to randomly choose where to put my character.

This is what I have for the box:
drawbox (1, 125, maxx, maxy, 1)

So I can select from 1-800 and 1-600. But when I randomly choose where I want my guy to go, I can only choose from like 1-36 and like 1-50.

How can I make it so I can choose from 1-800 and 1-600?
Sponsor
Sponsor
Sponsor
sponsor
Homer_simpson




PostPosted: Tue Jun 24, 2003 4:43 pm   Post subject: (No subject)

using View.maxx and View.maxy might work... =/
Andy




PostPosted: Wed Jun 25, 2003 11:34 am   Post subject: (No subject)

ok the character location is different from the graphical location, so instead of using locate, use locatexy which finds the closes cursor location from the given coordinates.
PaddyLong




PostPosted: Wed Jun 25, 2003 12:32 pm   Post subject: (No subject)

or randomize between 1 and maxcol and 1 and maxrow to randomize the location for text

row := Rand.Int (1, maxrow)
col := Rand.Int (1, maxcol)
locate (row, col)
put "some text"
Andy




PostPosted: Wed Jun 25, 2003 1:38 pm   Post subject: (No subject)

y bother having variables?
if ur gonna have variables juss use randint(variable,low,high) if ur gonna use Rand.Int, dun even use variables
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  [ 5 Posts ]
Jump to:   


Style:  
Search: