home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD114971182000.psc / Form2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-11-09  |  14.0 KB  |  471 lines

  1. VERSION 5.00
  2. Object = "{61E1E365-AC60-11D4-AA88-00A0CC334D72}#22.0#0"; "atOcx.ocx"
  3. Begin VB.Form Form2 
  4.    Caption         =   "at Test 2 - animation and ZOrder"
  5.    ClientHeight    =   6225
  6.    ClientLeft      =   1800
  7.    ClientTop       =   1590
  8.    ClientWidth     =   9495
  9.    ClipControls    =   0   'False
  10.    HasDC           =   0   'False
  11.    LinkTopic       =   "Form2"
  12.    Picture         =   "Form2.frx":0000
  13.    ScaleHeight     =   6225
  14.    ScaleWidth      =   9495
  15.    Begin VB.Timer Timer1 
  16.       Interval        =   50
  17.       Left            =   8940
  18.       Top             =   75
  19.    End
  20.    Begin atOcx.AniTrans aMove 
  21.       Height          =   1500
  22.       Index           =   6
  23.       Left            =   300
  24.       Top             =   1980
  25.       Width           =   1620
  26.       _ExtentX        =   2858
  27.       _ExtentY        =   2646
  28.       UserDataSize    =   0
  29.       HitTesting      =   1
  30.       CollisionChecking=   1
  31.       Animate         =   1
  32.       AnimDelay       =   100
  33.       CurFrame        =   2
  34.       FlipMode        =   0
  35.       Stretch         =   0   'False
  36.       aB              =   "Form2.frx":2DDD
  37.    End
  38.    Begin atOcx.AniTrans aMove 
  39.       Height          =   1440
  40.       Index           =   5
  41.       Left            =   60
  42.       Top             =   2970
  43.       Width           =   1500
  44.       _ExtentX        =   2646
  45.       _ExtentY        =   2646
  46.       UserDataSize    =   0
  47.       HitTesting      =   1
  48.       CollisionChecking=   1
  49.       Animate         =   1
  50.       AnimDelay       =   100
  51.       CurFrame        =   3
  52.       FlipMode        =   0
  53.       Stretch         =   0   'False
  54.       aB              =   "Form2.frx":6227
  55.    End
  56.    Begin atOcx.AniTrans aMove 
  57.       Height          =   1500
  58.       Index           =   0
  59.       Left            =   7905
  60.       Top             =   15
  61.       Width           =   1500
  62.       _ExtentX        =   2646
  63.       _ExtentY        =   2646
  64.       UserDataSize    =   0
  65.       HitTesting      =   1
  66.       CollisionChecking=   1
  67.       Animate         =   1
  68.       AnimDelay       =   100
  69.       CurFrame        =   5
  70.       FlipMode        =   0
  71.       Stretch         =   0   'False
  72.       MousePointer    =   15
  73.       aB              =   "Form2.frx":B57F
  74.    End
  75.    Begin atOcx.AniTrans aFly 
  76.       Height          =   1095
  77.       Index           =   0
  78.       Left            =   2175
  79.       Tag             =   "30"
  80.       Top             =   1575
  81.       Width           =   1245
  82.       _ExtentX        =   2196
  83.       _ExtentY        =   1931
  84.       UserDataSize    =   0
  85.       HitTesting      =   1
  86.       CollisionChecking=   1
  87.       Animate         =   1
  88.       AnimDelay       =   100
  89.       CurFrame        =   2
  90.       FlipMode        =   0
  91.       Stretch         =   0   'False
  92.       aB              =   "Form2.frx":CBF2
  93.    End
  94.    Begin atOcx.AniTrans aFly 
  95.       Height          =   1200
  96.       Index           =   1
  97.       Left            =   5760
  98.       Tag             =   "-30"
  99.       Top             =   2610
  100.       Width           =   1200
  101.       _ExtentX        =   2117
  102.       _ExtentY        =   2117
  103.       UserDataSize    =   0
  104.       HitTesting      =   1
  105.       CollisionChecking=   1
  106.       Animate         =   1
  107.       AnimDelay       =   100
  108.       CurFrame        =   3
  109.       FlipMode        =   0
  110.       Stretch         =   0   'False
  111.       aB              =   "Form2.frx":DCE1
  112.    End
  113.    Begin atOcx.AniTrans aFire 
  114.       Height          =   1500
  115.       Index           =   0
  116.       Left            =   1275
  117.       Top             =   -45
  118.       Width           =   1500
  119.       _ExtentX        =   2646
  120.       _ExtentY        =   2646
  121.       UserDataSize    =   0
  122.       HitTesting      =   1
  123.       CollisionChecking=   1
  124.       Animate         =   1
  125.       AnimDelay       =   100
  126.       CurFrame        =   6
  127.       FlipMode        =   0
  128.       Stretch         =   0   'False
  129.       aB              =   "Form2.frx":FE57
  130.    End
  131.    Begin atOcx.AniTrans aFire 
  132.       Height          =   1500
  133.       Index           =   1
  134.       Left            =   6120
  135.       Top             =   120
  136.       Width           =   1500
  137.       _ExtentX        =   2646
  138.       _ExtentY        =   2646
  139.       UserDataSize    =   0
  140.       HitTesting      =   1
  141.       CollisionChecking=   1
  142.       Animate         =   1
  143.       AnimDelay       =   100
  144.       CurFrame        =   9
  145.       FlipMode        =   0
  146.       Stretch         =   0   'False
  147.       aB              =   "Form2.frx":13F75
  148.    End
  149.    Begin atOcx.AniTrans aMove 
  150.       Height          =   900
  151.       Index           =   4
  152.       Left            =   1695
  153.       Tag             =   "0"
  154.       Top             =   3570
  155.       Width           =   1440
  156.       _ExtentX        =   2540
  157.       _ExtentY        =   1588
  158.       UserDataSize    =   0
  159.       HitTesting      =   1
  160.       CollisionChecking=   1
  161.       Animate         =   1
  162.       AnimDelay       =   100
  163.       CurFrame        =   5
  164.       FlipMode        =   0
  165.       Stretch         =   0   'False
  166.       aB              =   "Form2.frx":18093
  167.    End
  168.    Begin atOcx.AniTrans aMove 
  169.       Height          =   900
  170.       Index           =   3
  171.       Left            =   1995
  172.       Tag             =   "0"
  173.       Top             =   2715
  174.       Width           =   930
  175.       _ExtentX        =   1640
  176.       _ExtentY        =   1588
  177.       UserDataSize    =   0
  178.       HitTesting      =   1
  179.       CollisionChecking=   1
  180.       Animate         =   1
  181.       AnimDelay       =   100
  182.       CurFrame        =   4
  183.       FlipMode        =   0
  184.       Stretch         =   0   'False
  185.       aB              =   "Form2.frx":19150
  186.    End
  187.    Begin atOcx.AniTrans aEye 
  188.       Height          =   195
  189.       Left            =   3720
  190.       Top             =   1920
  191.       Width           =   360
  192.       _ExtentX        =   635
  193.       _ExtentY        =   344
  194.       UserDataSize    =   0
  195.       HitTesting      =   1
  196.       CollisionChecking=   1
  197.       Animate         =   1
  198.       AnimDelay       =   -1
  199.       CurFrame        =   2
  200.       FlipMode        =   0
  201.       Stretch         =   0   'False
  202.       aB              =   "Form2.frx":19C1A
  203.    End
  204.    Begin atOcx.AniTrans aMove 
  205.       Height          =   480
  206.       Index           =   1
  207.       Left            =   5445
  208.       Top             =   3135
  209.       Width           =   480
  210.       _ExtentX        =   847
  211.       _ExtentY        =   847
  212.       UserDataSize    =   0
  213.       HitTesting      =   1
  214.       CollisionChecking=   1
  215.       Animate         =   1
  216.       AnimDelay       =   100
  217.       CurFrame        =   13
  218.       FlipMode        =   0
  219.       Stretch         =   0   'False
  220.       aB              =   "Form2.frx":19EBA
  221.    End
  222.    Begin atOcx.AniTrans aMouse 
  223.       Height          =   1170
  224.       Left            =   135
  225.       Top             =   165
  226.       Width           =   1815
  227.       _ExtentX        =   3201
  228.       _ExtentY        =   2064
  229.       UserDataSize    =   0
  230.       HitTesting      =   1
  231.       CollisionChecking=   1
  232.       Animate         =   1
  233.       AnimDelay       =   100
  234.       CurFrame        =   27
  235.       FlipMode        =   0
  236.       Stretch         =   0   'False
  237.       aB              =   "Form2.frx":1A762
  238.    End
  239.    Begin atOcx.AniTrans aTiger 
  240.       Height          =   750
  241.       Left            =   2700
  242.       Top             =   690
  243.       Width           =   1200
  244.       _ExtentX        =   2117
  245.       _ExtentY        =   1323
  246.       UserDataSize    =   0
  247.       HitTesting      =   1
  248.       CollisionChecking=   1
  249.       Animate         =   1
  250.       AnimDelay       =   100
  251.       CurFrame        =   3
  252.       FlipMode        =   0
  253.       Stretch         =   0   'False
  254.       aB              =   "Form2.frx":28CE8
  255.    End
  256.    Begin VB.Line Line1 
  257.       Index           =   0
  258.       X1              =   -15
  259.       X2              =   9940
  260.       Y1              =   1365
  261.       Y2              =   1365
  262.    End
  263.    Begin atOcx.AniTrans aRabbit 
  264.       Height          =   1935
  265.       Left            =   7755
  266.       Tag             =   "-150"
  267.       Top             =   1245
  268.       Width           =   2025
  269.       _ExtentX        =   3572
  270.       _ExtentY        =   3413
  271.       UserDataSize    =   0
  272.       HitTesting      =   1
  273.       CollisionChecking=   1
  274.       Animate         =   1
  275.       AnimDelay       =   100
  276.       CurFrame        =   2
  277.       FlipMode        =   0
  278.       Stretch         =   0   'False
  279.       aB              =   "Form2.frx":2A631
  280.    End
  281.    Begin atOcx.AniTrans aJump 
  282.       Height          =   780
  283.       Left            =   3525
  284.       Tag             =   "-75"
  285.       Top             =   2130
  286.       Width           =   1320
  287.       _ExtentX        =   2328
  288.       _ExtentY        =   1376
  289.       UserDataSize    =   0
  290.       HitTesting      =   1
  291.       CollisionChecking=   1
  292.       Animate         =   1
  293.       AnimDelay       =   100
  294.       CurFrame        =   6
  295.       FlipMode        =   0
  296.       Stretch         =   0   'False
  297.       aB              =   "Form2.frx":2E012
  298.    End
  299.    Begin atOcx.AniTrans aMove 
  300.       Height          =   915
  301.       Index           =   2
  302.       Left            =   3045
  303.       Top             =   240
  304.       Width           =   3240
  305.       _ExtentX        =   5715
  306.       _ExtentY        =   1905
  307.       UserDataSize    =   0
  308.       HitTesting      =   1
  309.       CollisionChecking=   1
  310.       Animate         =   3
  311.       AnimDelay       =   -1
  312.       CurFrame        =   5
  313.       FlipMode        =   0
  314.       Stretch         =   0   'False
  315.       aB              =   "Form2.frx":3073E
  316.    End
  317.    Begin VB.Image Image2 
  318.       Height          =   1800
  319.       Left            =   5100
  320.       Picture         =   "Form2.frx":31BAA
  321.       Top             =   4440
  322.       Width           =   1995
  323.    End
  324.    Begin atOcx.AniTrans aTim 
  325.       Height          =   1530
  326.       Left            =   3375
  327.       Tag             =   "60"
  328.       Top             =   4635
  329.       Width           =   1755
  330.       _ExtentX        =   3096
  331.       _ExtentY        =   2699
  332.       UserDataSize    =   0
  333.       HitTesting      =   1
  334.       CollisionChecking=   1
  335.       Animate         =   1
  336.       AnimDelay       =   100
  337.       CurFrame        =   3
  338.       FlipMode        =   1
  339.       Stretch         =   0   'False
  340.       MousePointer    =   12
  341.       aB              =   "Form2.frx":32712
  342.    End
  343.    Begin VB.Image Image1 
  344.       Height          =   3675
  345.       Left            =   3315
  346.       Picture         =   "Form2.frx":35F94
  347.       Top             =   2565
  348.       Width           =   3780
  349.    End
  350. Attribute VB_Name = "Form2"
  351. Attribute VB_GlobalNameSpace = False
  352. Attribute VB_Creatable = False
  353. Attribute VB_PredeclaredId = True
  354. Attribute VB_Exposed = False
  355. Option Explicit
  356. Const PI = 3.1415926
  357. Private Sub aEye_OnFrameTick()
  358.     If aEye.CurFrame = 1 Then
  359.       With aEye
  360.         If .Tag <> "" Then
  361.             .Tag = ""
  362.             .Move Rnd * (ScaleWidth - .Width), Rnd * (ScaleHeight - .Height)
  363.         Else
  364.             .Tag = "x"
  365.         End If
  366.       End With
  367.     End If
  368. End Sub
  369. Private Sub aFire_OnFrameTick(Index As Integer)
  370.     With aFire(Index)
  371.         If .CurFrame = .FrameCount Then
  372.             .Move Rnd * (ScaleWidth - .Width), Rnd * (ScaleHeight - .Height)
  373.         End If
  374.     End With
  375. End Sub
  376. Private Sub aFly_OnFrameTick(Index As Integer)
  377.     With aFly(Index)
  378.         Dim x As Long
  379.         x = .Left + .Tag
  380.         If x < -.Width Or x > ScaleWidth Then .Tag = -.Tag
  381.         .Move x, ScaleHeight \ 2 + ScaleHeight * Sin(PI / 180 * (Timer * 100 + x / 10)) / 4
  382.     End With
  383. End Sub
  384. Private Sub aJump_OnFrameTick()
  385.     With aJump
  386.         Dim x As Long
  387.         If .Animate = AniForward Then x = 90 Else x = -90
  388.         .Left = .Left + x
  389.         If .Left > ScaleWidth Then .Animate = AniBackward
  390.         If .Left < -.Width Then .Animate = AniForward
  391.     End With
  392. End Sub
  393. Private Sub aMouse_OnFrameTick()
  394.     With aMouse
  395.         If aTiger.Left > 4900 Then
  396.             .AnimDelay = 150
  397.             If .CurFrame > 2 Then
  398.                 .CurFrame = 1
  399.                 .FlipMode = .FlipMode Xor FlipHorizontal
  400.             End If
  401.         Else
  402.             .FlipMode = FlipNone
  403.             .AnimDelay = 50
  404.         End If
  405.         If .CurFrame = .FrameCount Then .Visible = False
  406.     End With
  407. End Sub
  408. Private Sub aMove_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
  409.     Static dX As Long, dY As Long
  410.     If Button Then
  411.       With aMove(Index)
  412.         If dX Then
  413.             .Move .Left - dX + x, .Top - dY + Y
  414.             If .Tag <> "" Then .Tag = .Left
  415.         Else
  416.             dX = x
  417.             dY = Y
  418.         End If
  419.       End With
  420.     Else
  421.         dX = 0
  422.     End If
  423. End Sub
  424. Private Sub aMove_OnFrameTick(Index As Integer)
  425.     If Index Then
  426.         With aMove(Index)
  427.             If .Tag <> "" Then
  428.                 .Left = .Tag + Rnd * 300 - 150
  429.                 If .CurFrame Mod 3 = 0 Then .Visible = False Else .Visible = True
  430.             End If
  431.         End With
  432.     End If
  433. End Sub
  434. Private Sub aRabbit_OnFrameTick()
  435.     With aRabbit
  436.         .Left = .Left + .Tag
  437.         If .Left < -.Width Or .Left > ScaleWidth Then .Tag = -.Tag: .Animate = .Animate Xor AniBounce
  438.     End With
  439. End Sub
  440. Private Sub Form_Load()
  441.     aTiger.Left = ScaleWidth
  442.     aTim.Left = -aTim.Width
  443.     Dim i As Long
  444.     For i = 1 To aMove.UBound
  445.         aMove(i).MousePointer = aMove(0).MousePointer
  446.         If aMove(i).Tag <> "" Then aMove(i).Tag = aMove(i).Left
  447.         aMove(i).CurFrame = i
  448.     Next
  449. End Sub
  450. Private Sub Timer1_Timer()
  451.     Dim x As Long, i As Long
  452.     x = aTiger.Left - 60
  453.     If x < -aTiger.Width Then
  454.         x = ScaleWidth
  455.         aMouse.CurFrame = 1
  456.         aMouse.Animate = AniForward
  457.         aMouse.Visible = True
  458.     End If
  459.     aTiger.Left = x
  460.     With aTim
  461.         x = .Tag
  462.         If .FlipMode = 0 Then x = -x
  463.         .Left = .Left + x
  464.         If .Left > ScaleWidth Then .FlipMode = FlipNone
  465.         If .Left < -.Width Then .FlipMode = FlipHorizontal
  466.     End With
  467.     With aEye
  468.         .Move .Left + Rnd * 30 - 15, .Top + Rnd * 30 - 15
  469.     End With
  470. End Sub
  471.