home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 February / VPR0102A.BIN / PROGRAM / Form1.frm < prev    next >
Text File  |  2000-11-18  |  10KB  |  321 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "ブロック消し"
  5.    ClientHeight    =   6000
  6.    ClientLeft      =   2205
  7.    ClientTop       =   1740
  8.    ClientWidth     =   7455
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    Picture         =   "Form1.frx":0000
  12.    ScaleHeight     =   400
  13.    ScaleMode       =   3  'ピクセル
  14.    ScaleWidth      =   497
  15.    Begin VB.Timer Timer1 
  16.       Interval        =   50
  17.       Left            =   1920
  18.       Top             =   2640
  19.    End
  20.    Begin VB.ComboBox Combo1 
  21.       Height          =   300
  22.       Left            =   2400
  23.       Style           =   2  'ドロップダウン リスト
  24.       TabIndex        =   6
  25.       ToolTipText     =   "ボールの速度を選択"
  26.       Top             =   5520
  27.       Width           =   1335
  28.    End
  29.    Begin VB.CommandButton Command1 
  30.       Caption         =   "START"
  31.       Default         =   -1  'True
  32.       Height          =   375
  33.       Left            =   4800
  34.       TabIndex        =   5
  35.       ToolTipText     =   "ゲームを開始"
  36.       Top             =   5520
  37.       Width           =   1215
  38.    End
  39.    Begin VB.PictureBox paddle 
  40.       Appearance      =   0  'フラット
  41.       AutoRedraw      =   -1  'True
  42.       BackColor       =   &H80000005&
  43.       BorderStyle     =   0  'なし
  44.       Enabled         =   0   'False
  45.       ForeColor       =   &H80000008&
  46.       Height          =   255
  47.       Left            =   4800
  48.       Picture         =   "Form1.frx":91B82
  49.       ScaleHeight     =   17
  50.       ScaleMode       =   3  'ピクセル
  51.       ScaleWidth      =   49
  52.       TabIndex        =   4
  53.       Top             =   1560
  54.       Visible         =   0   'False
  55.       Width           =   735
  56.    End
  57.    Begin VB.PictureBox ball 
  58.       Appearance      =   0  'フラット
  59.       AutoRedraw      =   -1  'True
  60.       BackColor       =   &H80000005&
  61.       BorderStyle     =   0  'なし
  62.       Enabled         =   0   'False
  63.       ForeColor       =   &H80000008&
  64.       Height          =   255
  65.       Left            =   4920
  66.       Picture         =   "Form1.frx":92104
  67.       ScaleHeight     =   17
  68.       ScaleMode       =   3  'ピクセル
  69.       ScaleWidth      =   17
  70.       TabIndex        =   3
  71.       Top             =   960
  72.       Visible         =   0   'False
  73.       Width           =   255
  74.    End
  75.    Begin VB.PictureBox mainscr 
  76.       Appearance      =   0  'フラット
  77.       AutoRedraw      =   -1  'True
  78.       BackColor       =   &H00C0C0C0&
  79.       BorderStyle     =   0  'なし
  80.       ForeColor       =   &H80000008&
  81.       Height          =   735
  82.       Left            =   1320
  83.       ScaleHeight     =   49
  84.       ScaleMode       =   3  'ピクセル
  85.       ScaleWidth      =   129
  86.       TabIndex        =   2
  87.       Top             =   480
  88.       Width           =   1935
  89.    End
  90.    Begin VB.PictureBox blocks 
  91.       Appearance      =   0  'フラット
  92.       AutoRedraw      =   -1  'True
  93.       BackColor       =   &H80000005&
  94.       BorderStyle     =   0  'なし
  95.       Enabled         =   0   'False
  96.       ForeColor       =   &H80000008&
  97.       Height          =   2175
  98.       Left            =   3960
  99.       Picture         =   "Form1.frx":92586
  100.       ScaleHeight     =   145
  101.       ScaleMode       =   3  'ピクセル
  102.       ScaleWidth      =   33
  103.       TabIndex        =   1
  104.       Top             =   480
  105.       Visible         =   0   'False
  106.       Width           =   495
  107.    End
  108.    Begin VB.PictureBox offscr 
  109.       Appearance      =   0  'フラット
  110.       AutoRedraw      =   -1  'True
  111.       BackColor       =   &H00C0C0C0&
  112.       BorderStyle     =   0  'なし
  113.       Enabled         =   0   'False
  114.       ForeColor       =   &H80000008&
  115.       Height          =   735
  116.       Left            =   1320
  117.       ScaleHeight     =   49
  118.       ScaleMode       =   3  'ピクセル
  119.       ScaleWidth      =   129
  120.       TabIndex        =   0
  121.       Top             =   1440
  122.       Visible         =   0   'False
  123.       Width           =   1935
  124.    End
  125.    Begin VB.Label lblball 
  126.       BackColor       =   &H00000000&
  127.       Caption         =   "0"
  128.       BeginProperty Font 
  129.          Name            =   "MS Pゴシック"
  130.          Size            =   14.25
  131.          Charset         =   128
  132.          Weight          =   700
  133.          Underline       =   0   'False
  134.          Italic          =   0   'False
  135.          Strikethrough   =   0   'False
  136.       EndProperty
  137.       ForeColor       =   &H0080C0FF&
  138.       Height          =   255
  139.       Left            =   6840
  140.       TabIndex        =   11
  141.       Top             =   4845
  142.       Width           =   255
  143.    End
  144.    Begin VB.Label lblscore 
  145.       BackColor       =   &H00000000&
  146.       Caption         =   "0000"
  147.       BeginProperty Font 
  148.          Name            =   "MS Pゴシック"
  149.          Size            =   14.25
  150.          Charset         =   128
  151.          Weight          =   700
  152.          Underline       =   0   'False
  153.          Italic          =   0   'False
  154.          Strikethrough   =   0   'False
  155.       EndProperty
  156.       ForeColor       =   &H0080C0FF&
  157.       Height          =   255
  158.       Left            =   5040
  159.       TabIndex        =   10
  160.       Top             =   4845
  161.       Width           =   735
  162.    End
  163.    Begin VB.Label lblhiscore 
  164.       BackColor       =   &H00000000&
  165.       Caption         =   "00000"
  166.       BeginProperty Font 
  167.          Name            =   "MS Pゴシック"
  168.          Size            =   14.25
  169.          Charset         =   128
  170.          Weight          =   700
  171.          Underline       =   0   'False
  172.          Italic          =   0   'False
  173.          Strikethrough   =   0   'False
  174.       EndProperty
  175.       ForeColor       =   &H0080C0FF&
  176.       Height          =   255
  177.       Left            =   3000
  178.       TabIndex        =   9
  179.       Top             =   4845
  180.       Width           =   975
  181.    End
  182.    Begin VB.Label lblstage 
  183.       BackColor       =   &H00000000&
  184.       Caption         =   "00"
  185.       BeginProperty Font 
  186.          Name            =   "MS Pゴシック"
  187.          Size            =   14.25
  188.          Charset         =   128
  189.          Weight          =   700
  190.          Underline       =   0   'False
  191.          Italic          =   0   'False
  192.          Strikethrough   =   0   'False
  193.       EndProperty
  194.       ForeColor       =   &H0080C0FF&
  195.       Height          =   255
  196.       Left            =   1200
  197.       TabIndex        =   8
  198.       Top             =   4845
  199.       Width           =   495
  200.    End
  201.    Begin VB.Label Label1 
  202.       Caption         =   "SPEED :"
  203.       BeginProperty Font 
  204.          Name            =   "MS Pゴシック"
  205.          Size            =   14.25
  206.          Charset         =   128
  207.          Weight          =   700
  208.          Underline       =   0   'False
  209.          Italic          =   0   'False
  210.          Strikethrough   =   0   'False
  211.       EndProperty
  212.       Height          =   375
  213.       Left            =   1080
  214.       TabIndex        =   7
  215.       Top             =   5520
  216.       Width           =   1215
  217.    End
  218. End
  219. Attribute VB_Name = "Form1"
  220. Attribute VB_GlobalNameSpace = False
  221. Attribute VB_Creatable = False
  222. Attribute VB_PredeclaredId = True
  223. Attribute VB_Exposed = False
  224. '---------------------------------------------------------
  225. ' ブロック消しゲーム
  226. ' All rights reserved. Copyright (c) Toshiya Moto, 2000.
  227. '---------------------------------------------------------
  228. Option Explicit
  229.  
  230. '-----------------------------------------------------------------------
  231. ' イベントハンドラ
  232. '-----------------------------------------------------------------------
  233.  
  234. 'STARTボタンが押されたときに呼ばれるハンドラ
  235. Private Sub Command1_Click()
  236.     'ステージ開始
  237.     StartStage
  238. End Sub
  239.  
  240. 'タイマーから一定時間ごとに呼ばれるハンドラ
  241. Private Sub Timer1_Timer()
  242.     If boPlaying Then
  243.         'インターバル処理
  244.         TimerProc
  245.         
  246.         'ステージクリアか判定
  247.         If IsClearStage Then
  248.             ClearStage
  249.         End If
  250.         
  251.         'ゲームオーバーか判定
  252.         If IsGameOver Then
  253.             GameOver
  254.         End If
  255.     End If
  256. End Sub
  257.  
  258. 'マウスをクリックしたときに呼ばれるハンドラ
  259. Private Sub mainscr_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  260.     'ステージ開始
  261.     StartStage
  262. End Sub
  263.  
  264. 'マウスが移動したときに呼ばれるハンドラ
  265. Private Sub mainscr_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  266.     'マウス移動処理
  267.     MouseMoveProc Int(X)
  268. End Sub
  269.  
  270. '-----------------------------------------------------------------------
  271. ' ゲームの制御
  272. '-----------------------------------------------------------------------
  273.  
  274. 'ステージ開始処理
  275. Private Sub StartStage()
  276.     If Not boPlaying Then
  277.         Form1.Command1.Enabled = False  'STARTボタンを禁止
  278.         Form1.Combo1.Enabled = False    '速度選択コンボを禁止
  279.         boPlaying = True                'プレイ中
  280.     
  281.         'ボール速度選択コンボボックスの値により、タイマー
  282.         'コントロールのインターバル値を設定
  283.         Select Case Combo1.ListIndex
  284.             Case 1:
  285.                 Timer1.Interval = 50
  286.             Case 2:
  287.                 Timer1.Interval = 20
  288.             Case Else
  289.                 Timer1.Interval = 80
  290.         End Select
  291.         
  292.         'ステージ開始処理
  293.         StartStageProc
  294.     End If
  295. End Sub
  296.  
  297. 'ステージクリア処理
  298. Private Sub ClearStage()
  299.     If boPlaying Then
  300.         'ステージクリア処理
  301.         ClearStageProc
  302.  
  303.         Form1.Command1.Enabled = True   'STARTボタンを許可
  304.         Form1.Combo1.Enabled = True     '速度選択コンボを許可
  305.         boPlaying = False               'プレイ中でない
  306.     End If
  307. End Sub
  308.  
  309. 'ゲームオーバー処理
  310. Private Sub GameOver()
  311.     If boPlaying Then
  312.         'ゲームオーバー処理
  313.         GameOverProc
  314.  
  315.         Form1.Command1.Enabled = True   'STARTボタンを許可
  316.         Form1.Combo1.Enabled = True     '速度選択コンボを許可
  317.         boPlaying = False               'プレイ中でない
  318.     End If
  319. End Sub
  320.  
  321.