Results 1 to 3 of 3

Thread: Code for collision of top of shape...

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2002
    Location
    Where you live
    Posts
    104

    Question Code for collision of top of shape...

    Hey..

    Im trying to write my fishing program and im getting stuck on the coding for a collision which only occurs if the y2 part of the line pierces the top of a shape. The shape must be hit by the y2 part of the line not at the middle of the line or ne thing. The shape is 495 x 255 (a rectangle) and is hidden underneath a fish that scrolls across the screen. I need it so when the fisher casts his line and the line hits any part of the top of the shape then the collision even occurs. Any help?

    Thanks,

    edit: Ok I found out a way to work it, though it is limiting. The line before didnt completely become equal to the top of the shape :

    If Line1.Y2 = Shape1.Top And Line1.X2 >= Shape1.Left Then fish4.Visible = False

    so I adjusted the shape and fishes position so now it does become equal so it works...but that is limiting because now i have to make the fish in set positions if the line is to become equal. Any way around this?
    Last edited by Inno; May 19th, 2002 at 10:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width