Jump to content


Photo

need explanation


  • Please log in to reply
5 replies to this topic

#1 mihashi

mihashi

    GMC Member

  • GMC Member
  • 40 posts
  • Version:GM8

Posted 17 August 2012 - 05:34 PM

hi

in this function

collision_circle(xc,yc,radius,obj,prec,notme)

what is the purpose of "prec" and "notme"; i know those are booleens, but apart from filling them with true, or false
i don't get what's their purpose;

i tried changing the value but no notifiable effect

so if someone could en-light me that'll be much appreciated
  • 0

#2 johnkapid

johnkapid

    Lead of hEOLiX

  • GMC Member
  • 143 posts
  • Version:GM:Studio

Posted 17 August 2012 - 05:43 PM

Game Maker help file:

"The argument prec indicates whether the check should be precise or only based on the bounding box of the instance. Precise checking is only done when the sprite for the instance has the precise collision checking set. The argument notme can be set to true to indicate that the calling instance should not be checked."
  • 0

#3 mihashi

mihashi

    GMC Member

  • GMC Member
  • 40 posts
  • Version:GM8

Posted 17 August 2012 - 05:54 PM

what i need to do is like a radar surrounding my player and trigger an alert if other objects are
within the range of the radar.

so if i understand what you said early
i have to put notme to true for my player not being a part of the check.
  • 0

#4 icymx

icymx

    Patrick Brett

  • GMC Member
  • 790 posts
  • Version:GM8

Posted 18 August 2012 - 01:41 AM

prec is short for for "Precise". If true, it checks for precise collisions within the sprite's bounding box. If false, it will only check for collisions with the rectangular outside of the sprite.

notme is short for "Not me", which literally means "not me". If true, it won't count collisions with the object the function is called from (e.g. If the function is being called from obj_enemy and notme is set to true, if another obj_enemy enters the collision circle it won't affect the result). If false, other instances of the same object affect the output.
  • 0

#5 SEC

SEC

    Watchful

  • Global Moderators
  • 284 posts
  • Version:GM:Studio

Posted 18 August 2012 - 04:29 AM

You should probably use this for a radar:

The front part is so if there are no enemys, it will not crash.

Var dist;
If round(real(insance_count(enemy))) < 1 {
dist = Point_distance(self.x,self.y,enemy.x,enemy.y)
If dist < 50 { } //Make 50 whatever you want to range of the radar to be. Inside the curly braces is whatever happens when //there is an enemy inside
}

Note: It's better to explain about your problem in the title (etc. "Radar system") and not "need help". Because this is the questions and answers forum, it's safe to assume you need help. :happy:
  • 0

#6 mihashi

mihashi

    GMC Member

  • GMC Member
  • 40 posts
  • Version:GM8

Posted 20 August 2012 - 10:41 AM

thks for the tips
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users