VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form main 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Panic Level Editor v1.0"
   ClientHeight    =   6465
   ClientLeft      =   1155
   ClientTop       =   1905
   ClientWidth     =   9570
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   FillColor       =   &H00C0C0C0&
   ForeColor       =   &H00000000&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   6465
   ScaleWidth      =   9570
   Begin VB.CommandButton clearlevel 
      Appearance      =   0  'Flat
      Caption         =   "Clear Level"
      Height          =   735
      Left            =   240
      TabIndex        =   17
      Top             =   5640
      Width           =   4575
   End
   Begin VB.OptionButton opBlank 
      Height          =   300
      Left            =   8640
      TabIndex        =   16
      Top             =   5280
      Width           =   200
   End
   Begin VB.PictureBox blank 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   495
      Left            =   7680
      ScaleHeight     =   465
      ScaleWidth      =   585
      TabIndex        =   15
      Top             =   5160
      Width           =   615
   End
   Begin VB.PictureBox Picture11 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   0
      Picture         =   "leveleditor.frx":0000
      ScaleHeight     =   345
      ScaleWidth      =   345
      TabIndex        =   14
      Top             =   2280
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.PictureBox Wallpic 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   615
      Left            =   7680
      Picture         =   "leveleditor.frx":3696
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   13
      Top             =   1080
      Width           =   615
   End
   Begin VB.PictureBox BombPic 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   615
      Left            =   7680
      Picture         =   "leveleditor.frx":4FE48
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   12
      Top             =   1920
      Width           =   615
   End
   Begin VB.PictureBox TimeInc 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   615
      Left            =   7680
      Picture         =   "leveleditor.frx":5151A
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   11
      Top             =   2760
      Width           =   615
   End
   Begin VB.PictureBox TimeDec 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   615
      Left            =   7680
      Picture         =   "leveleditor.frx":52BEC
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   10
      Top             =   3600
      Width           =   615
   End
   Begin VB.PictureBox poisonpic 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   495
      Left            =   7680
      Picture         =   "leveleditor.frx":542BE
      ScaleHeight     =   465
      ScaleWidth      =   585
      TabIndex        =   9
      Top             =   4440
      Width           =   615
   End
   Begin VB.OptionButton opWall 
      Height          =   300
      Left            =   8640
      TabIndex        =   6
      Top             =   1200
      Width           =   200
   End
   Begin VB.OptionButton opTimeInc 
      Height          =   300
      Left            =   8640
      TabIndex        =   5
      Top             =   2880
      Width           =   200
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Export Level"
      Height          =   300
      Left            =   7680
      TabIndex        =   4
      Top             =   5880
      Width           =   1335
   End
   Begin VB.OptionButton opTimeDec 
      Height          =   300
      Left            =   8640
      TabIndex        =   3
      Top             =   3720
      Width           =   200
   End
   Begin VB.OptionButton opPoison 
      Height          =   300
      Left            =   8640
      TabIndex        =   2
      Top             =   4560
      Width           =   200
   End
   Begin VB.OptionButton opBomb 
      Height          =   300
      Left            =   8640
      TabIndex        =   1
      Top             =   2040
      Value           =   -1  'True
      Width           =   200
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      FillColor       =   &H00FF0000&
      FillStyle       =   0  'Solid
      ForeColor       =   &H00FF0000&
      Height          =   375
      Index           =   0
      Left            =   0
      ScaleHeight     =   345
      ScaleWidth      =   345
      TabIndex        =   0
      Top             =   1920
      Width           =   375
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   0
      Top             =   960
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Label totallevs 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      ForeColor       =   &H80000008&
      Height          =   495
      Left            =   0
      TabIndex        =   20
      Top             =   1440
      Visible         =   0   'False
      Width           =   495
   End
   Begin VB.Label levelnumber 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   6240
      TabIndex        =   19
      Top             =   5760
      Width           =   735
   End
   Begin VB.Label currentlev 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Level:"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   375
      Left            =   5160
      TabIndex        =   18
      Top             =   5760
      Width           =   975
   End
   Begin VB.Label RightBG 
      BackColor       =   &H00C00000&
      Height          =   5535
      Left            =   7560
      TabIndex        =   8
      Top             =   960
      Width           =   2055
   End
   Begin VB.Label Title 
      Alignment       =   2  'Center
      Caption         =   "Panic Level Editor v1.0"
      BeginProperty Font 
         Name            =   "Century Gothic"
         Size            =   36
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   0
      TabIndex        =   7
      Top             =   0
      Width           =   9855
   End
   Begin VB.Menu mnufile 
      Caption         =   "&File"
      Begin VB.Menu mnunew 
         Caption         =   "&New"
         Shortcut        =   ^N
      End
      Begin VB.Menu mnuexit 
         Caption         =   "&Exit"
         Shortcut        =   ^X
      End
   End
End
Attribute VB_Name = "main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command1_Click()
z = ".db "
For X = 0 To 21 Step 3
For Y = 0 To 33 Step 3
    If Y <> 33 Then
        If Picture1(X * 20 + Y).Picture = BombPic.Picture Then z = z & "3,"
        If Picture1(X * 20 + Y).Picture = Wallpic.Picture Then z = z & "1,"
        If Picture1(X * 20 + Y).Picture = poisonpic.Picture Then z = z & "7,"
        If Picture1(X * 20 + Y).Picture = TimeInc.Picture Then z = z & "5,"
        If Picture1(X * 20 + Y).Picture = TimeDec.Picture Then z = z & "6,"
        If Picture1(X * 20 + Y).Picture = Picture11.Picture Then z = z & "0,"
    Else
        If Picture1(X * 20 + Y).Picture = BombPic.Picture Then z = z & "3"
        If Picture1(X * 20 + Y).Picture = Wallpic.Picture Then z = z & "1"
        If Picture1(X * 20 + Y).Picture = poisonpic.Picture Then z = z & "7"
        If Picture1(X * 20 + Y).Picture = TimeInc.Picture Then z = z & "5"
        If Picture1(X * 20 + Y).Picture = TimeDec.Picture Then z = z & "6"
        If Picture1(X * 20 + Y).Picture = Picture11.Picture Then z = z & "0"
    End If
    
Next Y
Print #1, z
If X > 15 Then Print #1, ".db 0,0,0,0,0,0,0,0,0,0,0,0"
If X > 15 Then GoTo Cur2

z = ".db "
Next X
Close #1


Cur2:
Close #1
Open CommonDialog1.FileName For Append As #1
z = ".db "
For X = 0 To 21 Step 3
For Y = 0 To 33 Step 3
    If Y <> 33 Then
        If Picture1(X * 20 + Y).Picture = BombPic.Picture Then z = z & "4,"
        If Picture1(X * 20 + Y).Picture = Wallpic.Picture Then z = z & "2,"
        If Picture1(X * 20 + Y).Picture = poisonpic.Picture Then z = z & "7,"
        If Picture1(X * 20 + Y).Picture = TimeInc.Picture Then z = z & "5,"
        If Picture1(X * 20 + Y).Picture = TimeDec.Picture Then z = z & "6,"
        If Picture1(X * 20 + Y).Picture = Picture11.Picture Then z = z & "0,"
    Else
        If Picture1(X * 20 + Y).Picture = BombPic.Picture Then z = z & "4"
        If Picture1(X * 20 + Y).Picture = Wallpic.Picture Then z = z & "2"
        If Picture1(X * 20 + Y).Picture = poisonpic.Picture Then z = z & "7"
        If Picture1(X * 20 + Y).Picture = TimeInc.Picture Then z = z & "5"
        If Picture1(X * 20 + Y).Picture = TimeDec.Picture Then z = z & "6"
        If Picture1(X * 20 + Y).Picture = Picture11.Picture Then z = z & "0"
    End If
    
Next Y
Print #1, z
If X > 15 Then Print #1, ".db 0,0,0,0,0,0,0,0,0,0,0,0" & ""
If X > 15 Then MsgBox ("Level Exported Succesfully!")
If X > 15 Then levelnumber.Caption = levelnumber.Caption + 1
If X > 15 Then Exit Sub
z = ".db "
Next X

End Sub

Private Sub Form_Load()
levelnumber.Caption = 1
l = InputBox$("Number of Levels", "Panic Level Editor v1.0")
totallevs.Caption = l
CommonDialog1.Filter = "z80 Files (*.z80)"
CommonDialog1.FilterIndex = 1
CommonDialog1.FileName = "*.z80"
CommonDialog1.DialogTitle = "Export Levelset."
'CommonDialog1.Action = 2
CommonDialog1.ShowSave
On Error GoTo UhOh

Open CommonDialog1.FileName For Append As #1
Dim X As Integer, Y As Integer, z As String
Print #1, ";Created in Panic Level Editor v1.0"
Print #1, ";by Cole South and Joel Seligstein."
Print #1, ";bugs/comments to Sk8a4good@aol.com"
Print #1, ""
Print #1, ""
Print #1, ""
z = ".db "
Print #1, z & Chr(34) & "PNCLVL" & Chr(34) & ",0"  'Chr(34) is a quotation mark, prints detect string
Print #1, z & l   'prints number of levels
For X = 0 To 18 Step 3
For Y = 0 To 33 Step 3
    If X > 0 Or Y > 0 Then Load Picture1(X * 20 + Y)
    Picture1(X * 20 + Y).Left = Y * 150 + 1500
    Picture1(X * 20 + Y).Top = X * 150 + 1500
    Picture1(X * 20 + Y).Width = 495
    Picture1(X * 20 + Y).Height = 495
    Picture1(X * 20 + Y).Visible = True
    Picture1(X * 20 + Y).BorderStyle = 1
    Picture1(X * 20 + Y).Picture = Picture11.Picture
Next Y
Next X
UhOh:
Beep
Exit Sub
End Sub



Private Sub clearlevel_Click()
l = l + 1
For X = 0 To 18 Step 3
For Y = 0 To 33 Step 3
    If X > 0 Or Y > 0 Then 'Load Picture1(x * 20 + Y)
    Picture1(X * 20 + Y).Left = Y * 150 + 1500
    Picture1(X * 20 + Y).Top = X * 150 + 1500
    Picture1(X * 20 + Y).Width = 495
    Picture1(X * 20 + Y).Height = 495
    Picture1(X * 20 + Y).Visible = True
    Picture1(X * 20 + Y).BorderStyle = 1
    Picture1(X * 20 + Y).Picture = Picture11.Picture
    End If
Next Y
Next X
End Sub

Private Sub mnuexit_Click()
End
End Sub

Private Sub mnunew_Click()
q = 1
levelnumber.Caption = q
l = InputBox$("Number of Levels", "Panic Level Editor v1.0")
CommonDialog1.Filter = "z80 Files (*.z80)"
CommonDialog1.FilterIndex = 1
CommonDialog1.FileName = "*.z80"
CommonDialog1.DialogTitle = "Export Levelset."
'CommonDialog1.Action = 2
CommonDialog1.ShowSave
On Error GoTo UhOh

Open CommonDialog1.FileName For Append As #1
Dim X As Integer, Y As Integer, z As String
Print #1, ";Created in Panic Level Editor v1.0"
Print #1, ";by Cole South and Joel Seligstein."
Print #1, ";bugs/comments to Sk8a4good@aol.com"
Print #1, ""
Print #1, ""
Print #1, ""
z = ".db "
Print #1, z & Chr(34) & "PNCLVL" & Chr(34) & ",0"  'Chr(34) is a quotation mark, prints detect string
Print #1, z & l   'prints number of levels
Print #1, ""
Print #1, ";Start of Level Data..."
Print #1, ""
For X = 0 To 18 Step 3
For Y = 0 To 33 Step 3
    If X > 0 Or Y > 0 Then Load Picture1(X * 20 + Y)
    Picture1(X * 20 + Y).Left = Y * 150 + 1500
    Picture1(X * 20 + Y).Top = X * 150 + 1500
    Picture1(X * 20 + Y).Width = 495
    Picture1(X * 20 + Y).Height = 495
    Picture1(X * 20 + Y).Visible = True
    Picture1(X * 20 + Y).BorderStyle = 1
    Picture1(X * 20 + Y).Picture = Picture11.Picture
Next Y
Next X
UhOh:
Beep
Exit Sub
End Sub

Private Sub Picture1_Click(Index As Integer)
If opWall.Value = True Then Picture1(Index).Picture = Wallpic.Picture
If opBomb.Value = True Then Picture1(Index).Picture = BombPic.Picture
If opTimeInc.Value = True Then Picture1(Index).Picture = TimeInc.Picture
If opTimeDec.Value = True Then Picture1(Index).Picture = TimeDec.Picture
If opPoison.Value = True Then Picture1(Index).Picture = poisonpic.Picture
If opBlank.Value = True Then Picture1(Index).Picture = Picture11.Picture


End Sub


