Jump to content


Photo

What is this funtion that I'm thinking of?


  • Please log in to reply
6 replies to this topic

#1 MasterElement

MasterElement

    GMC Member

  • New Member
  • 362 posts

Posted 03 June 2012 - 06:32 PM

What is the one where you can determine weither an object is x or y different for another.
For example lets say we have player object and another object, how do we figure out in code if the player's Y position is lower then the other objects?
I hope that makes sense.
  • 0

#2 kelson

kelson

    GMC Member

  • GMC Member
  • 303 posts

Posted 03 June 2012 - 06:36 PM

i think this is what you are looking for
if player.y < obj_other.y
{
do whatever
}
  • 0

#3 creators124

creators124

    awesomeliciousmember

  • GMC Member
  • 866 posts
  • Version:GM8

Posted 03 June 2012 - 06:37 PM

What is the one where you can determine weither an object is x or y different for another.
For example lets say we have player object and another object, how do we figure out in code if the player's Y position is lower then the other objects?
I hope that makes sense.

can't you use:
if (obj_first.x <= obj_second.x or obj_first.x >= obj_second.x) 
{
//do this
}
if (obj_first.y <= obj_second.y or obj_first.y >= obj_second.y) 
{
do this
}
seems simple but no I have no idea sorry. Posted Image

Edited by creators124, 03 June 2012 - 06:38 PM.

  • 0

#4 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 460 posts
  • Version:GM8.1

Posted 03 June 2012 - 06:49 PM

I don't think there's a function for that and you have to do it manually.
Or were you talking about distance_to_point?
  • 0

#5 MasterElement

MasterElement

    GMC Member

  • New Member
  • 362 posts

Posted 03 June 2012 - 07:00 PM

I think Jlm07 is right, none of those functions work, But I have not idea how to code this manually.
  • 0

#6 kelson

kelson

    GMC Member

  • GMC Member
  • 303 posts

Posted 03 June 2012 - 07:38 PM

well if you described what you want this for we would be able to help you more. because i am having a hard time seeing what you need from this.

as far as i can see
!place_meeting(x,y,obj_other)
or
if !x=obj_other.x and !y=obj_other.y
{
}

is about all i can come up with to help you out

Edited by kelson, 03 June 2012 - 07:41 PM.

  • 0

#7 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 460 posts
  • Version:GM8.1

Posted 03 June 2012 - 07:46 PM

Well, the above methods should work:
if ((y) > (another_object.y))
{
//do something
}
//if y is larger than another_object's y position
//the perform events

  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users