im almost completely new at programming (I'm using vb 2010, though searching around on the internet everything seems to be .NET or vb6)
i'm trying to make a sort of space invaders-type game (i know vb isnt the language to use but i'm really just doing it to pass the time) and am having trouble getting the bot that you play as to "shoot"
i can get it to shoot once, then wait it out till it hits the aliens / goes out of bounds, but can not make it fire two bullets, one after the other.
i've written this much:
ElseIf e.KeyChar = ChrW(Keys.Space) Then bullet = New PictureBox Me.Controls.Add(bullet) bullet.BringToFront() bullet.Width = 6 bullet.Height = 20 bullet.BackColor = Color.Red bullet.Visible = True bullet.Left = bot.Left bullet.Top = bot.Top
to create a new "bullet" each time space is pressed but the timer that controls the movement of the bullet freezes the first bullet as soon as the second is shot
here is what i've written under the "timer_tick" sub:
If bullet.Left >= alien.Left - 5 And bullet.Left <= alien.Left + 39 And bullet.Top <= alien.Top + 40 Then Timer1.Enabled = False MsgBox("You Win!!!") bullet.Visible = False Timer1.Enabled = False ElseIf bullet.Top = 0 Then bullet.Visible = False Else bullet.Top = bullet.Top - 2 End If
(line ten being where the movement happens)
i've tried creating a new timer_tick sub each time space is pressed but it doesn't work.
any help would be greatly appreciated