Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Test if any object is on a location  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

kim366

  • Newbie
  • *
  • Posts: 35
    • View Profile
Test if any object is on a location
« on: December 03, 2013, 04:28:12 pm »
Hello!

I have 2 Integers. one for x Location and one for y. And i want a boolean to be true whenever any object is on those coordinates.



Sorry for my bad english

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Test if any object is on a location
« Reply #1 on: December 03, 2013, 04:49:36 pm »
if (location.x == object.x && location.y == object.y)
{
   // Profit???
}
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

kim366

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Test if any object is on a location
« Reply #2 on: December 05, 2013, 05:30:15 pm »
I dont just want to check if one object is there, but if any object is there.

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: Test if any object is on a location
« Reply #3 on: December 05, 2013, 05:42:04 pm »
Then just add a loop?

 

anything