Boundries

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
Boundries

Post by Guest » Fri Jan 03, 2003 7:50 am

I wrote a racing game but I can't keep the Cars out of the walls.  I used the POINT function to stop it from going into the walls but as you speed up it messes it up.  The way I have it check is:  It checks the point right outside the car, if I am going slow enough it works, I have the speed increase by spd = spd +1 so at its fastest, its jumping about 5 pixels per frame.  Since it only checks one pixel away, it is two pixels away when it PUTs it it puts it in the wall causing an assortment of errors.  I have tried numerous different things t fix this but none work.    ??? TEXT I need the car to stop at the wall without going through it, does anyone know a quick and efficient way of doing this?

User avatar
frankiebaby
Global Moderator
Posts:95
Joined:Tue Apr 30, 2002 1:38 am
Location:Pennsylvania
Contact:

Re: Boundries

Post by frankiebaby » Mon Jan 06, 2003 12:51 am

Well, i assume it looks kinda like this?

IF POINT (X + 1,Y) = COLOR THEN

USE SUMTHIN LIKE THIS

IF POINT (X + spd, Y) = COLOR

Post Reply