The Daily Click ::. Forums ::. Klik Coding Help ::. Selecting the object on the highest layer.
 

Post Reply  Post Oekaki 
 

Posted By Message

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1545

VIP Member
6th January, 2013 at 06/01/2013 07:03:35 -

I'm making an isometric game which requires you to click and select (by turning a flag on) specific objects and interact with them. The problem is I want to make sure you can only select one item at a time and when two items are overlapping each other and they are clicked both items are not selected.

I want to make it so when you click an object that is overlapping another object, only the object on the highest layer will be selected. Alternatively it could be the object with the highest Y value is selected (as the highest layered objects are closer to the bottom as the screen)


Can anyone think of any methods of achieving this?

 

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1545

VIP Member
6th January, 2013 at 06/01/2013 07:12:59 -

I forgot to mention, I also plan to release this for iOS so the extensions I can use are very limited.

 

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
6th January, 2013 at 06/01/2013 14:41:51 -

I had the same problem with one of my old software projects. You can download it (and the open source Event List) here:

http://create-games.com/download.asp?id=8049

There was an issue with multiple target locations being created in the path of the same lightning bolt, and what would happen is the target first overlapped by the lightning bolt would cause an explosion, even if the target further down the screen (with the greater Y coordinate) was first.

I'm fairly sure I simply used Spread Values to solve the issue. Have a look at the open source file for more info. It may solve your issue, or it may inspire you to approach your problem from a different direction.

Keep us posted on your success, Buster.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click