Array of a bullet
Array of a bullet
Array of a bullet
Array of a bullet
Array of a bullet
Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet
Array of a bullet Array of a bullet
Array of a bullet
Go Back  Xtreme Visual Basic Talk > > > Array of a bullet


Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2014, 01:56 AM
Vb beginner Vb beginner is offline
Newcomer
 
Join Date: Oct 2014
Posts: 2
Default Array of a bullet


i have a problem......i have been making a game so i'm stuck in the shooting of fire,Basically the game is about Space Invaders so please tell me that when i prees Space key it shoot fire.........making an array of the image..img_bullet and moving it straight away......like it makes an array and the new bullet goes .top-80
PLEASE HELP ME
Reply With Quote
  #2  
Old 10-29-2014, 05:24 PM
passel's Avatar
passelArray of a bullet passel is offline
Sinecure Expert

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

The original Space Invaders defender could only fire one bullet at a time. You had to wait until the bullet went of the top or hit an invader before you could fire again. That was part of the challenge. If you missed, you had a while to wait.
Perhaps post the code in question.
I can't tell if you want an array to fire multiple bullets, or are using an array as part of your animation of one bullet path.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
  #3  
Old 10-29-2014, 10:30 PM
Vb beginner Vb beginner is offline
Newcomer
 
Join Date: Oct 2014
Posts: 2
Unhappy

can't we do like

Code:
dim bullet as new bullet
to make an array of the bullet
Reply With Quote
  #4  
Old 10-30-2014, 07:04 PM
passel's Avatar
passelArray of a bullet passel is offline
Sinecure Expert

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

That doesn't make an array.
Assuming bullet is a class, it would try to make an instance of the bullet in a variable by the name of bullet. I haven't done a lot of vb6 classes, so don't know if it is legal to use the name of the class as an instance of a class.

If you want to create an array, then you need to create an array. Then instantiation instances of the class for items in the array.
Code:
Dim bullets(9) as bullet 'create an array of 10 bullets

'Then perhaps in the form load event
For i = 0 to 9
  bullets(i) = new bullet
Next
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.

Last edited by passel; 11-05-2014 at 08:28 AM.
Reply With Quote
  #5  
Old 11-01-2014, 06:53 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

I use a type, something like
(maybe public isn't good)

public type Bullets
X as integer
Y as integer
Visible as Boolean
end type

public Bullet (10) as bullets
__________________
The Pho·net·ic Programmer
Reply With Quote
  #6  
Old 11-02-2014, 05:44 PM
dotnetwrassler dotnetwrassler is offline
Regular
 
Join Date: Sep 2014
Location: USA (Pacific/West Coast)
Posts: 71
Default Re: CLASS as Keyword

Quote:
Originally Posted by passel
..so don't know if it is legal to use the name of the class as an instance of a class
.
Here is the old MSDN list of VB6 keywords (and "CLASS" is not among them).
Of course CLASS is a VB.NET Keyword.

However, per dilettante, there are technical workarounds for
using Reserved Words as VB6 Class Member Names.
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
Array of a bullet
Array of a bullet
Array of a bullet Array of a bullet
Array of a bullet
Array of a bullet
Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet Array of a bullet
Array of a bullet
Array of a bullet
 
Array of a bullet
Array of a bullet
 
-->