Collision Detection Function
A small function to detect collision between 2 objects!
AI
Ringkasan AI: 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.
Kode Sumber
<pre> <font color=blue>Function</font> IsCollide(Object1 <font color=blue>As Object</font>, Object2 <font color=blue>As Object</font>) <font color=blue>As Boolean Dim</font> Ob1 <font color=blue>As Object Dim</font> Ob2 <font color=blue>As Object Set</font> Ob1 = Object1 <font color=blue>Set</font> Ob2 = Object2 <font color=blue>If</font> Ob1.Left < Ob2.Left + Ob2.Width <font color=blue>And</font> Ob1.Left + Ob1.Width > Ob2.Left <font color=blue>And</font> Ob1.Top < Ob2.Top + Ob2.Height <font color=blue>And</font> Ob1.Top + Ob1.Height > Ob2.Top <font color=blue>Then</font> IsCollide = <font color=blue>True Else</font> IsCollide = <font color=blue>False End If End Function</font><hr> </pre> Please provide some feedback about this post.
Komentar Asli (3)
Dipulihkan dari Wayback Machine