'shoot at surface touch or buton pressed
If firewait<=0 Then
Dim LaserShot As typLaser
LaserShot.X = Player.X +Player.Width - LaserShotSize
LaserShot.Y = Player.y + 0.5*Player.Height'position the gun
LaserShots.Add(LaserShot)
SP.Play(LaserSound, 1 - (LaserShot.X / 100%x), LaserShot.X / 100%x, 1, 0, 1)
firewait=500'postpone fire
End If
'take care of shoot, compute colision and laser position usualy in surface update
Dim Secs As Double = Elapsed / 1000
firewait = firewait - Elapsed' calculate speed
For i = LaserShots.Size - 1 To 0 Step -1
Dim LaserShot As typLaser 'get the laser object from list
LaserShot = LaserShots.Get(i)
'colision missing
' destroy the laser when out of screen
LaserShot.x = LaserShot.x + (Secs * LaserSpeed)
If LaserShot.x > ACSF.Width Then LaserShots.RemoveAt(i)
Next
'Draws the laser shots
Dim LaserShot As typLaser, R As Rect
For i = 0 To LaserShots.Size - 1
LaserShot = LaserShots.Get(i)
R.Initialize(LaserShot.X, LaserShot.Y, LaserShot.X + LaserShotSize, LaserShot.Y + 0.5%x)
AC.DrawRect(R, Colors.Cyan, True, 0, False)
Next