Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Check for Collision End?  (Read 757 times)

0 Members and 1 Guest are viewing this topic.
Check for Collision End?
« on: February 20, 2007, 11:50:48 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
I know how to check whether a collision is happening with an object (duh, Collision Event), but how do I check if the collision stops happening? Thanks!
Logged
  • Lionfish Apps

Goodnight

Once and future Captain
Re: Check for Collision End?
« Reply #1 on: February 21, 2007, 12:03:55 am »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
Collision functions in the Step event can do both:

Code: [Select]
if place_meeting(x,y,obj) {
    // constant collision code here
    if !colliding {
        // instant collision code here
    }
    colliding=true;
} else {
    // constant non-collision code here
    if colliding {
        // instant non-collision code here
    }
    colliding=false;
}
Logged
Re: Check for Collision End?
« Reply #2 on: February 21, 2007, 12:48:13 am »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
It works, but if I stand in a certain three pixels of the object it stops detecting... Wierdness.
Logged
  • Lionfish Apps

Goodnight

Once and future Captain
Re: Check for Collision End?
« Reply #3 on: February 21, 2007, 07:36:47 am »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
Yeh, sounds weird... but that should have nothing to do with the code.
Logged
Re: Check for Collision End?
« Reply #4 on: February 21, 2007, 04:34:48 pm »
  • Lionfish App dev
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3456
I could just make its bounding box a bit wider. That'd probably work, right? Thanks for the help!
Logged
  • Lionfish Apps
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.056 seconds with 44 queries.