J
JonnyF2000
Guest
Hello all,
I'm trying to write an extremely basic spaceship program and i want to know if there is an easier way to detect if my ship(a picturebox with a ship picture) hits an asteroid(another picture box). Right now i just have loads of if ...then statements that say for example...
if picship.left > 16 and picship.left < 48 and picship.top > 48 and picship.top < 88 then
msgbox(strname & " You crashed!")
intlives = intlives - 1
lbllives.text = intlives
picship.location = new point(8,8)
endif
what i want to know is if there is anyway to just write the code so that if picship.location = picasteroid.location then do my above statements. i tried saving the objects locations as system.drawing.point variables and running it when loc1(the ships location) = loc2(the asteriouds location) but it says "=" isnt allowed with type system.drawing.point. Any help would be greatly welcomed. Thanks in advance/
I'm trying to write an extremely basic spaceship program and i want to know if there is an easier way to detect if my ship(a picturebox with a ship picture) hits an asteroid(another picture box). Right now i just have loads of if ...then statements that say for example...
if picship.left > 16 and picship.left < 48 and picship.top > 48 and picship.top < 88 then
msgbox(strname & " You crashed!")
intlives = intlives - 1
lbllives.text = intlives
picship.location = new point(8,8)
endif
what i want to know is if there is anyway to just write the code so that if picship.location = picasteroid.location then do my above statements. i tried saving the objects locations as system.drawing.point variables and running it when loc1(the ships location) = loc2(the asteriouds location) but it says "=" isnt allowed with type system.drawing.point. Any help would be greatly welcomed. Thanks in advance/