Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Graphics 640,480,0,2
  2. SetBuffer BackBuffer()
  3.  
  4. Global backgroundimage = LoadImage("background.bmp")
  5. Global backgroundXpos = 0
  6.  
  7. Global heliImage = LoadImage("helicopter.bmp")
  8. Global heliXpos = 50
  9. Global heliYpos = 120
  10.  
  11. Global hinderImage = LoadImage("hinder.bmp")
  12. Global hinderXpos = 0
  13. Global hinderYpos = 0
  14.  
  15. Global bulletImage = LoadImage("C:\Users\Sanna_2\Desktop\helicopter\bullet.bmp")
  16.  
  17.  
  18.  
  19. Global stage = 1
  20.  
  21. While Not KeyHit(1)
  22.  Cls
  23.         Select stage
  24.                 Case 1
  25.                     Fdrawimages()
  26.                     Ferror()
  27.                     Text 320,240,"press Enter to begin flying",1,1
  28.                     If KeyHit(28) Then stage = 2
  29.                 Case 2
  30.                     Fdrawimages()
  31.                    
  32.                     Fmoveimages()
  33.                     Fflycopter()
  34.                     Fcollision()
  35.                 Case 3
  36.                     Fdrawimages()
  37.                     Text 320,240,"YOU LOST!!",1,1
  38.         End Select
  39.  Flip
  40. Wend
  41.  
  42. End
  43.  
  44. Function Fdrawimages()
  45.  
  46. TileImage(backgroundimage,backgroundXpos,0)
  47. DrawImage(hinderImage,hinderXpos,hinderYpos)
  48. DrawImage(heliImage,heliXpos,heliYpos)
  49. DrawImage(bulletImage,50,50)
  50.  
  51.  
  52. End Function
  53.  
  54. Function Fmoveimages()
  55.  
  56. backgroundXpos = backgroundXpos - 5
  57. If backgroundXpos = -640 Then backgroundXpos = 0
  58.  
  59. hinderXpos = hinderXpos - 10
  60. hinderYpos = hinderYpos = 3
  61. If hinderXpos = -1900 Then hinderXpos = 640
  62. If hinderYpos > 480 Then hinderYpos = 480
  63. End Function
  64.  
  65. Function Fflycopter()
  66.  
  67. If KeyDown(203) Then heliXpos = heliXpos - 5
  68. If KeyDown(205) Then heliXpos = heliXpos + 5
  69. If MouseDown(1) Then
  70.         heliYpos = heliYpos - 5
  71. Else
  72.         heliYpos = heliYpos + 10
  73.  
  74.  
  75. If heliXpos < -15 Then heliXpos = -14
  76. If heliXpos > 452 Then heliXpos = 453
  77. If heliYpos > 40 Then heliYpos = 39
  78.  
  79. End If
  80.  
  81. End Function
  82.  
  83. Function Fcollision()
  84.  
  85. If ImagesCollide(heliImage,heliXpos,heliYpos,0,hinderImage,hinderXpos,hinderYpos,0) Then stage = 3
  86.  
  87. End Function
  88.  
  89. Function Ferror()
  90.  
  91. If Not bulletImage Then DebugLog "Nope!"
  92.  
  93.  
  94.  
  95. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement