×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Coordinates off screen

Coordinates off screen

Coordinates off screen

(OP)
I am making a game is qb4.5 its a dungeon explorer like the old game Eye of the beholder, where you move one
square at a time and you can side step and turn.  What I want to be able to do is load a previously designed map
and have that as the dungeon you can move through.  Sort of like the level-creators for doom2 if anyone remembers
them like deu2 and waded.  The problem I am having is connecting two points where one point is the origin in a
200x200 box and the other is actually not a coordinate on the screen.  So what I need to know is how do I know
the x,y coordinates of the point just before the line leaves the screen? Or using math how can I find the x,y?

RE: Coordinates off screen

I'm having difficulty understanding what the problem is.  It seems pretty simple since you can use negative x,y coordinates.  I'm sure there's something more to it than that though.
Could you clarify your problem and toss in some examples and/or code you're working with?

RE: Coordinates off screen

(OP)
Well its a little tricky to explain.  picture a map a classic dungeons and dragons map the ones that look like crossword puzzles that you do on grid paper. I convert that to a 3d view  where you can move one space at a time either forward, backward, turn left turn right, thats it.  So i translate the 2d map into a 3d coordinates now if you want to figure out where a diagonal line goes for anything not in the center you have to reference it to a logical point off screen. Ah thats the best explaination I can give without a picture, the code would only confuse it more.  Picture a square 201x201 and in that square is a smaller square then a smaller and smaller etc... until we get to the center. it will look like a passage if you connect the four corners of the first square with the center (diagonals).  Now say the 3rd square in has a square of equal size adjacent to it on the right (equations work out the same for left or right) now we want to draw the diagonals for that square, keeping in mind anything beyond 201 is classified as offscreen so now because we're one square to the right the diagonals to give it depth connect not to the corners of the first square (screen square)as with the one centered but to an adjecent square by the first. so in other words the first square is (x,y) (0,0)-(200,200) the one beside it is (200,0)-(400,200)  
and the diagonals for this 3rd square in connect to the corners of it. So if we want to say we have the 3rd square three squares along the square we connect the diagonls to is offscreen and anything more than that is also offscreen. So how can I do the diagonals without getting an illegal function call?

RE: Coordinates off screen

I understand what you're trying to do and it makes sense how it works.  I guess I need to know the exact command that gives you an illegal function call.  Normally, commands like DRAW or LINE don't have any problems with negative coordinates, or coordinates outside of your VIEW SCREEN, but commands like PUT simply won't.  If it is a PUT command, I don't know of any work around to putting it outside of the VIEW SCREEN area.
Either way, which command gives the error?

RE: Coordinates off screen

(OP)
Its pset that returns an illegal function call.  You know though I think I'm going to have to use a different method using formulas that instead tell me the last pixel coordinate before the line goes offscreen.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close