Just a simple question ^^ lazarus / 9-Editor ---------------------------------------------------------------------- GoDxNero · 2009-11-03 14:55 I got 2 shapes. Shape1 can be moves with keypress event ( up,down and sides ). I want so that if shape1 touch or come above shape2 some events will occur like shape2 disappear. Just like in the 'snake game'. How to do this ? So far I am just using left and top. Like if shape1.left = shape2.left and shape1.top = shape2.top then shape2 disappear. But I dont think its a handy way. I know there are a lots of events with TShape but I am not to familiar with them yet so I dont know which or how to use them . Perhaps someone can tell me which event I should use and if possible a small example . Thanks alots in advance. ---------------------------------------------------------------------- Blaazen · 2009-11-03 15:16 Hi, some ten years ago, when I used Delphi for making games, there was components DelphiX, which had TSprite, which generated event collision when one object collided with other. This is also the way how it was used on old 8-bit computers like Commodere or Atari. I think you can use TShape for shapes like square or rectangle, because it's easy to calculate it, but collision of triangle and circle would be more complicated. I think there are aslo some "gaming" components for Lazarus. But TShape has no event for collision with other component. B. ---------------------------------------------------------------------- theo · 2009-11-03 15:21 If you have only full squares, then you can check this after every keypress event: uses types; var ARect:TRect; begin Caption:=BoolToStr(IntersectRect(ARect,Shape1.BoundsRect,Shape2.Bounds Rect),true); end;