Question Respawning

samcp16

Member
Joined
Jan 27, 2012
Messages
8
Programming Experience
1-3
Hi, im creating a simple game in visual basic 2010 and was wondering what code would be required to allow a picture box to disappear and re-appear, the picture box will be moving to the left i would like it to appear back at its starting position once another picture box has collided with it or to simply "re spawn".
Thanks :)
 
If you want to make a control appear and disappear then you can call its Show and Hide methods or set its Visible property. To move a control you can set its Top or Left property to move it on one axis only or its Location property to move it on both axes.
 
If you want to make a control appear and disappear then you can call its Show and Hide methods or set its Visible property. To move a control you can set its Top or Left property to move it on one axis only or its Location property to move it on both axes.

thanks, i was able to make it re-appear but im having trouble getting it to appear in a different location to coordinates the picture box started at, any advice would be great. thanks
 
the trouble was the picture boxes were moving to the left, so each time the two picture boxes were colliding, yes the enemy was getting set back, but because they were moving they were re spawning closer to the left. How do I set the location property of a picture box?, sorry for the questions ive only been programming for a short time
 
What exactly did you not understand about the information provided in the documentation for the Location property? You say that you have only been programming for a short time so obviously reading the instructions is the first thing you should be doing when you find something you don't know. Every type and member in the .NET Framework class library has a topic dedicated to it in the MSDN documentation. When you want to know how to use a type or member, that topic should be the first thing you read. Not surprisingly, many of them have code examples, including the one for the Location property. If you know you need to use the Location property, as you do, then the first thing you should do is read that documentation. 30 seconds later, you have the answer to your question. Only if the documentation doesn't answer your question should you search the web for other information and examples. Only if you still can't find an answer should you ask a question on a forum like this. I'm not saying don't use forums. I use them myself, but only as a last resort when I have looked in all the obvious places. The Help documentation is the most obvious place.
 

Latest posts

Back
Top