Computer Science Canada

Screen Size??

Author:  Archi [ 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?

Author:  Homer_simpson [ Tue Jun 24, 2003 4:43 pm ]
Post subject: 

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

Author:  Andy [ Wed Jun 25, 2003 11:34 am ]
Post 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.

Author:  PaddyLong [ Wed Jun 25, 2003 12:32 pm ]
Post 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"

Author:  Andy [ Wed Jun 25, 2003 1:38 pm ]
Post 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