detecting a control is under another control

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
ok short and sweet i'm making a nibbles-clone in the original nibbles game i'm still working on the actual "snake" but one of the things i'm going to need it to do is every time the timer fires and the snake moves i'm going to need it to see if it's on top of any other control (being a picturebox cause the snake is a line of picturebox's 7x7pixels) or a label (being the label with the number in it or a lable that's border)

i'm not sure where to begin i would like something generic as when the level shifts even the borders will be shifted
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
The easiest way would be to use an array to store a grid with the name of the objects in. Then when the snake moves check the grid location it's moving to for an object.
 
Top Bottom