1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

how do you have have something happen between two functions?

Discussion in 'Programming' started by bimblor, Dec 3, 2019.

  1. bimblor

    bimblor Member

    Joined:
    Dec 2, 2019
    Posts:
    2
    sorry if i'm doing something wrong, this is my first post.

    if image_xscale < 2 image_xscale > 2.5
    {
    if (place_meeting(x,y,object0)) {

    instance_destroy(object0)


    }
    }

    im trying to make it so object0 is destroyed when colliding with object1 between < 2 and > 2.5.
     
  2. BattleRifle BR55

    BattleRifle BR55 Member

    Joined:
    Jun 24, 2016
    Posts:
    996
    For one, you're only performing one check as you should be using && to make both comparisons.

    Two, how can the scale be below 2 and above 2.5 at the same time? Surely you mean for those expressions to be flipped.
     
  3. bimblor

    bimblor Member

    Joined:
    Dec 2, 2019
    Posts:
    2
    oops, you're right, that was the problem the whole time. sorry for the unnecessary thread.
     
  4. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,136
    Remember: The alligator eats the larger value.
    [​IMG]

    Or if you're more of a musician:

    p < f
    f > p
     
    Simon Gust and BattleRifle BR55 like this.
  5. BattleRifle BR55

    BattleRifle BR55 Member

    Joined:
    Jun 24, 2016
    Posts:
    996
    Man, I was going to do the alligator thing. but I quickly no longer felt like it. :p
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice