Knowing whether two objects intersect
This simple function let you easily know if two objects intersect. You can use it for making games or for any other purpose.
AI
KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Quellcode
Public Function Hit(Object1 As Object, Object2 As Object) As Boolean If Object1.Left > Object2.Left - Object1.Width And Object1.Left - Object2.Width < Object2.Left And Object1.Top - Object2.Top < Object2.Top And Object1.Top > Object2.Top - Object1.Top Then Hit = True If Object1.Left > Object2.Left - Object1.Width And Object1.Left - Object2.Width < Object2.Left And Object1.Top - Object2.Height < Object2.Top And Object1.Top > Object2.Top - Object1.Height Then Hit = True End Function
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine