Oooh, a game (kinda...) I know how to do this, i made a space invaders in VB once. That was probably one of my greatest creations in VB. And it wasnt just some silly single level clone. It had an unlimited amout of levels, each level the enemy would get faster and shoot more until about level 50 when they would stay the same (got a bit crazy when i made it go faster) Even had pickups n whatnot and the ship that passes by every now and then up the top. I even got so bored i made a bot that would play the game. Wasnt an 100% accurate bot of course, that would be boring, it would even seek out powerups when they came down, if 2 came down it would go for the best and if one was coming down but too many aliens were shooting it would stay back so it didnt get shot.
Damn, i went abit off topic :\ sorry, i loved that game, but i lost all of it, its completley gone
anywho, all the shapes (well, almost all objects) have a .left and a .top property, this contains the position of the top of the object and the left of the object (duh). You will also need to use the .width and .hieght properties too.
Code: Select all
if SCircle.left > BCircle.left and (SCircle.left + SCircle.width) < (BCircle.left + BCircle.width) then
if SCircle.top < BCircle.top and (SCircle.top-SCircle.Height) > (BCricle.top - BCircle.Height then
'whatever you want to do when the small shape is in the big one
end if
end if
S=Small B=Big
Of course youll need to modify the names n whatnot and change the code to work with a square too. You could use an array of objects for the smaller shapes but im not sure if they are available in vb.net onwards, they took some sort of array out of it, cant remember which though.
Im guessing i might be a bit late on this anyway, been a while since you posted it.