⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cplayer.cls

📁 3D纵版射击程序
💻 CLS
📖 第 1 页 / 共 2 页
字号:
            If Shield < 0 Then
                Hitpoints = Hitpoints + Shield
                Shield = 0
            End If
        Else
            Hitpoints = Hitpoints - Int(L_oShot.Power * (Parent.Difficulty + 1))
        End If
            
    End If
    
    If Hitpoints < 50 Then
        If Parent.FrameCount Mod (10 + IIf(Not Parent.Detail, 10, 0)) = 0 Then
            Parent.Level.Effects.Add "SMOKESHIP", PositionX, PositionY, 0, 10
            Parent.Level.Message = "critical damage"
        End If
    End If
    
    If Hitpoints < 0 Then
        
        Parent.Level.Message = "ship lost"
        
        Parent.Level.Effects.Add "EXPLO3", PositionX, PositionY, 0, 0
        Parent.Level.Effects.Add "EXPLO2", PositionX - I_oMasterFrame.Width * 5 + I_oMasterFrame.Width * 10 * Rnd, PositionY - I_oMasterFrame.Height \ 5 + I_oMasterFrame.Height * 10 * Rnd, 0, 0
        Parent.Level.Effects.Add "EXPLO2", PositionX - I_oMasterFrame.Width * 5 + I_oMasterFrame.Width * 10 * Rnd, PositionY - I_oMasterFrame.Height \ 5 + I_oMasterFrame.Height * 10 * Rnd, 0, 0
        Parent.Level.Effects.Add "EXPLO4", PositionX, PositionY, 0, 0
        
        Select Case Orbiter
        
            Case 1
                Parent.Level.Effects.Add "EXPLO3", I_nOrbiterX, I_nOrbiterY, 0, 0
                
            Case 2
                Parent.Level.Effects.Add "EXPLO3", I_nOrbiterX - I_oMasterFrame.Width * 5 - 150, I_nOrbiterY - I_oOrbiterFrame.Height * 5 + I_oMasterFrame.Height * 5 + 100, 0, 0
                Parent.Level.Effects.Add "EXPLO3", I_nOrbiterX + I_oMasterFrame.Width * 5 + 150, I_nOrbiterY - I_oOrbiterFrame.Height * 5 + I_oMasterFrame.Height * 5 + 100, 0, 0
            
            Case 3
                Parent.Level.Effects.Add "EXPLO3", (I_nOrbiterX + 350 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), 0, 0
            
            Case 4
                Parent.Level.Effects.Add "EXPLO3", (I_nOrbiterX + 350 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), 0, 0
                Parent.Level.Effects.Add "EXPLO3", (I_nOrbiterX + 350 * Cos(((Parent.FrameCount + 90) Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin(((Parent.FrameCount + 90) Mod 180) * 2 * PIFACTOR)), 0, 0
            
        End Select
        
        Active = False
        Lifes = Lifes - 1
        If Lifes < 0 Then
            StartDelay = 300
            PositionY = 10000
            I_nOrbiterY = 10000
            If Score >= Parent.Campaign.HighScore Then
                Parent.Campaign.HighScore = Score
                Parent.Campaign.HighStars = Stars
                Parent.Campaign.WriteHigh
            End If
        Else
            StartDelay = 100
            Reset
        End If
        
        Exit Sub
        
    End If
    
    If I_nShotCount < I_nShotDelay Then I_nShotCount = I_nShotCount + 1
    If I_nOrbiterCount < I_nOrbiterDelay Then I_nOrbiterCount = I_nOrbiterCount + 1
    
    PositionX = PositionX + DeltaX
    PositionY = PositionY + DeltaY
    
    I_nOrbiterX = I_nOrbiterX + (PositionX - I_nOrbiterX) \ 20
    I_nOrbiterY = I_nOrbiterY + (PositionY - I_nOrbiterY) \ 20
    
    If PositionX < 300 Then
        DeltaX = 0
        PositionX = 300
    End If
    
    If PositionX > 3700 Then
        DeltaX = 0
        PositionX = 3700
    End If
    
    If PositionY < 3300 Then
        DeltaY = 0
        PositionY = 3300
    End If
    
    If PositionY > 4700 Then
        DeltaY = 0
        PositionY = 4700
    End If
    
End Sub

Public Sub Shoot()

     If I_nOrbiterCount = I_nOrbiterDelay Then
        
        Select Case Orbiter
        
            Case 1
                Parent.Level.Shots.Add "PLAYER2", I_nOrbiterX, I_nOrbiterY + I_oMasterFrame.Height * 5 + 10, I_nOrbiterX, 0, True
                
            Case 2
                Parent.Level.Shots.Add "PLAYER2", I_nOrbiterX - I_oMasterFrame.Width * 5 - 150, I_nOrbiterY - I_oOrbiterFrame.Height * 5 + I_oMasterFrame.Height * 5 + 100, I_nOrbiterX - I_oMasterFrame.Width * 5 - 150, 0, True
                Parent.Level.Shots.Add "PLAYER2", I_nOrbiterX + I_oMasterFrame.Width * 5 + 150, I_nOrbiterY - I_oOrbiterFrame.Height * 5 + I_oMasterFrame.Height * 5 + 100, I_nOrbiterX + I_oMasterFrame.Width * 5 + 150, 0, True
            
            Case 3
                Parent.Level.Shots.Add "PLAYER3", (I_nOrbiterX + 350 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterX + 250 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), 0, True
            
            Case 4
                Parent.Level.Shots.Add "PLAYER3", (I_nOrbiterX + 350 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), (I_nOrbiterX + 250 * Cos((Parent.FrameCount Mod 180) * 2 * PIFACTOR)), 0, True
                Parent.Level.Shots.Add "PLAYER3", (I_nOrbiterX + 350 * Cos(((Parent.FrameCount + 90) Mod 180) * 2 * PIFACTOR)), (I_nOrbiterY + 350 * Sin(((Parent.FrameCount + 90) Mod 180) * 2 * PIFACTOR)), (I_nOrbiterX + 250 * Cos(((Parent.FrameCount + 90) Mod 180) * 2 * PIFACTOR)), 0, True
            
        End Select
        
        I_nOrbiterCount = 0
        
     End If
    
     If I_nShotCount = I_nShotDelay Then
   
        Select Case Weapon
        
            Case 0
                
                Select Case Mounts
                    Case 1
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 - 20, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 20 + (Rnd * 500) - 250, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 1
                    Case 2
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 - 95, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 95 + (Rnd * 500) - 250, 0, True
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 + 55, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 55 + (Rnd * 500) - 250, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 2
                    Case Else
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 - 95, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 95 + (Rnd * 500) - 250, 0, True
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 - 20, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 20 + (Rnd * 500) - 250, 0, True
                        Parent.Level.Shots.Add "PLAYER1", PositionX + I_oMasterFrame.Width \ 2 + 55, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 55 + (Rnd * 500) - 250, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 3
                End Select
                
            Case 1
            
                Select Case Mounts
                    Case 1
                        Parent.Level.Shots.Add "PLAYER2", PositionX + I_oMasterFrame.Width \ 2 - 20, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 20, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 1
                    Case Else
                        Parent.Level.Shots.Add "PLAYER2", PositionX + I_oMasterFrame.Width \ 2 - 95, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 95, 0, True
                        Parent.Level.Shots.Add "PLAYER2", PositionX + I_oMasterFrame.Width \ 2 + 55, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 55, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 2
                End Select
                
            Case 2
            
                Select Case Mounts
                    Case 1
                        Parent.Level.Shots.Add "PLAYER3", PositionX + I_oMasterFrame.Width \ 2 - 160, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 160, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 1
                    Case Else
                        Parent.Level.Shots.Add "PLAYER3", PositionX + I_oMasterFrame.Width \ 2 - 160, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 160, 0, True
                        Parent.Level.Shots.Add "PLAYER3", PositionX + I_oMasterFrame.Width \ 2 + 110, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 110, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 2
                End Select
                
            Case 3
                Select Case Mounts
                    Case Else
                        Parent.Level.Shots.Add "PLAYER4", PositionX + I_oMasterFrame.Width \ 2 - 10, PositionY - 100, PositionX + I_oMasterFrame.Width \ 2 - 10, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 1
                End Select
                
            Case 4
                Select Case Mounts
                    Case 1
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 1
                    Case 2
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2 - 150, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 1000, 0, True
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2 + 150, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 1000, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 2
                    Case Else
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2 - 150, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 - 1000, 0, True
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2, 0, True
                        Parent.Level.Shots.Add "PLAYER5", PositionX + I_oMasterFrame.Width \ 2 + 150, PositionY - 50, PositionX + I_oMasterFrame.Width \ 2 + 1000, 0, True
                        Me.Stat_OwnShotsFired = Me.Stat_OwnShotsFired + 3
                End Select
                
        End Select
        
        I_nShotCount = 0
        
    End If
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -