Recent

Author Topic: Collision detection between sqaures  (Read 2388 times)

guest62676

  • Guest
Collision detection between sqaures
« on: June 23, 2018, 03:34:37 pm »
Hey,
so I know there may be similar threads here but none really helped me out by now so here I am.

I've got 2 TShapes which are squares, one can be moved with the arrow keys.
One of the TShapes is supposed to be an obstacle, a wall if u want.
I tried around a good amount of time but can't seem to be getting anywhere.
Can anyone help me here with an example maybe?

Thank you

Handoko

  • Hero Member
  • *****
  • Posts: 5129
  • My goal: build my own game engine using Lazarus
Re: Collision detection between sqaures
« Reply #1 on: June 23, 2018, 04:04:55 pm »
Hello yakumi,
Welcome to the forum.

Show us your code first, then we can better help you based on what you've already got.

Bart

  • Hero Member
  • *****
  • Posts: 5274
    • Bart en Mariska's Webstek
Re: Collision detection between sqaures
« Reply #2 on: June 23, 2018, 04:39:49 pm »
TRect.IntersectsWith(R: TRect): Boolean; ?

Bart

lainz

  • Hero Member
  • *****
  • Posts: 4460
    • https://lainz.github.io/
Re: Collision detection between sqaures
« Reply #3 on: June 23, 2018, 04:54:08 pm »
TRect.IntersectsWith(R: TRect): Boolean; ?

Bart

Good =)

 

TinyPortal © 2005-2018