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

Username:   Password: 
 RegisterRegister   
 Banana Throw: Outside Clipping Region
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Pickles




PostPosted: Tue May 04, 2004 6:24 am   Post subject: Banana Throw: Outside Clipping Region

Basically, I am making a version of the QBasic Gorillas game, I have used sprites (as we are working in 3.11) for the banana. The problems I am encountering are when the banana goes off the screen and the run window saying "Outside Clipping Region" comes up. The banana still carries on its course and if it wasnt for this annoying run window the player wouldn't know anythings wrong.

For when it goes over the top of the screen, I have:
code:
            if y22 > maxy then

                y22 := maxy
                counter := 5 %All banana sprites become hidden
            end if


This hides the bananas once it reaches maxy, and prevents it from going out of clipping region. I can't figure out how to make it so it shows the coming down motion, as if the banana went off the screen then came back down.

Also, how come when I use "if x22>maxx" or some similar coords to check to see if it is off the screen on the right side, it will work up on the top half of the screen but when i get down to the lower parts it doesn't, does this have to do with the parabolic trajectory of my banana?

Help is much appreciated, thx
Sponsor
Sponsor
Sponsor
sponsor
Flashkicks




PostPosted: Tue May 04, 2004 6:45 am   Post subject: (No subject)

I cant remember; Does the older Turing recognize ("offscreenonly") ??..if so- set your graphics to that.[/code]
Tony




PostPosted: Tue May 04, 2004 12:51 pm   Post subject: (No subject)

what you could do is to have the full trajectory of the banana ( Laughing ) but draw it only when it is on the screen (probably what you're doing already)

i don't really understand your "not working on lower part" issue. Post the code where the problem occurs
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Pickles




PostPosted: Tue May 04, 2004 3:36 pm   Post subject: ..

Doh, I think I see what you mean, instead of seeing when its offscreen, see when its onscreen and draw it then.. i was going about it backwards. Ill give that a try.

CAn't really post one part of code as its all jumbled and in a mess right now but basically
What i mean by its not working on the lower part is that when i do

"exit my throwing loop when bananax > maxx -4 (just regular maxx wouldnt work had to make it stop first)"

this works up on say the top half of the screen, and the loop is exited, but once you get down to say 200 up from the bottom then the 4 no longer becomes good enough, it goes cheap and out of clipping region, i think this might have to do with the trajectory, as when im making it go out at the bottom section it has to have a very steep trajectory.
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: