Space invaders
Space invaders
Space invaders
Space invaders
Space invaders
Space invaders Space invaders Space invaders Space invaders Space invaders Space invaders Space invaders Space invaders
Space invaders Space invaders
Space invaders
Go Back  Xtreme Visual Basic Talk > > > Space invaders


Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2013, 02:41 PM
joey15 joey15 is offline
Newcomer
 
Join Date: Mar 2013
Posts: 1
Default Space invaders


I'm building a space invaders game and it's almost done,but what i still need is:
count the pictureboxes destroyed and when they reach 0 i receive a msgbox that takes me to the next level.
so how to count the pictureboxes( I have 28)
I have a general idea that i should declare them as variables but when i try it, it doesn't work...
so any advices or hints?
Reply With Quote
  #2  
Old 03-11-2013, 08:40 AM
passel's Avatar
passelSpace invaders passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

Set a variable, probably a type of Integer would be best, and set it to 28 when you start a round. Each time you "destroy" a picturebox, subtract 1 from the variable. When it reaches 0, all the pictureboxes have been destroyed.
Example:
'In the Declarations area of your form:
Private NumberOfAliens as Integer

In your initialization for each level when you enable and position your 28 pictureboxes set the variable to 28:
NumberOfAliens = 28

Where you do your hit detect, and destroy the picturebox:
NumberOfAliens -= 1 'decrement the number of aliens

If NumberOfAliens <= 0 Then 'there are no more aliens
' Do your end round processing, and setup for the next level
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Space invaders
Space invaders
Space invaders Space invaders
Space invaders
Space invaders
Space invaders Space invaders Space invaders Space invaders Space invaders Space invaders Space invaders
Space invaders
Space invaders
 
Space invaders
Space invaders
 
-->