The Daily Click ::. Forums ::. Klik Coding Help ::. pixel in frame
 

Post Reply  Post Oekaki 
 

Posted By Message

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
7th November, 2005 at 07:33:49 -

hey, i got a problem..
im not very good at english, but im still try to be clear.
how can i do that, one point (cordinate, x;y) is overlapping an active object?!
im not thinking of that object's cordinate.. i hope all of you know what i mean...

any suggestion?
thanks

Borgi

 
:C

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
7th November, 2005 at 08:15:00 -

So - how to detect if any part of an object is at a certain point?

It could be done by having a one-pixel object at that point and testing for a collision normally, but this seems awfully awkward... you could test to see if the object had its left edge below the X position you're checking for, right edge above it, then the top edge below the Y coordinate and the bottom edge below it. However, this would only work if the object was perfectly square, or near to it.

Any other suggestions?

 
http://www.davidn.co.nr - Games, music, living in America

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
7th November, 2005 at 09:02:42 -

i dont want to use, one pixel object, because, then there will a lot of object on the frame, i think too many for the mmf..
i dont understand your secound solution... sorry, cant u send me by a mmf application?

 
:C

Jakob37



Registered
  07/08/2005
Points
  541
7th November, 2005 at 13:28:42 -

I donīt know any other way to solve it but you can change the maximum number of objects in a frame by rightclicking the frame properties>explore from here>number of objects at runtime, and there set a bigger value (You must change this on all the frames you need more objects in.) Then you can use Davids first suggestion.



 
n/a

hishnak



Registered
  18/04/2004
Points
  994
7th November, 2005 at 13:53:44 -

Well, If you don't want to use active objects its going to be nearly as awkward to have to make a range of x/y positions for every little area.
You would have to do something like

Just say your play area is 181x181

Player pos. is less than right edge-90 and players position is greater than left edge+90 and players y pos. is less than top edge-90 and players pos. is greater than bottom edge +90.

That would make a one pixel range(I believe) and as you can see it would be a reall pain to make that event differn't for every single area...Anybody understand.

 
I'm feeling a bit wella

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
8th November, 2005 at 05:37:59 -

You could go with the one pixel idea, and then use a loop to move it around and check for collisions. Constantly running large loops will hinder your application though.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
8th November, 2005 at 15:39:56 -

You could make one single 1-pixel object, and then create the rest using events. You could make them act individually by spreading a value through the 1-pixel object.

 
Old member (~2004-2007).

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
8th November, 2005 at 22:11:34 -

It should be something like this:
Let's say the point is represented by p, and p(x) is the point's x position and p is the point's y position

if (object's x >= p(x) and object's x <= p(x) + object's right x) and (object's y >= p and object's y <= p + object's bottom y) then overlapping = true

You can get object's right/left x co-ordinates from the "position" menu in the conditions editor.

 
http://www.klik-me.com

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
10th November, 2005 at 11:27:41 -

thanks guys, i hope i can make it

 
:C
   

Post Reply



 



Advertisement

Worth A Click