Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2012
116
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\********\Desktop\helicopter\bullet.bmp")
  16. Global bulletXpos = 50
  17. Global bulletYpos = 50
  18.  
  19. Global stage = 1
  20.  
  21. While Not KeyHit(1)
  22.  Cls
  23.         Select stage
  24.                 Case 1
  25.                     Fdrawimages()
  26.  
  27.                     Text 320,240,"press Enter to begin flying",1,1
  28.                     Text 320,220,"håll i vänster musknapp för att flyga uppåt",1,1
  29.                     Text 320,200,"flyg framåt eller bakåt med vänster/höger pil",1,1
  30.                     If KeyHit(28) Then stage = 2
  31.                 Case 2
  32.                     Fdrawimages()
  33.  
  34.                     Fmoveimages()
  35.                     Fflycopter()
  36.                     Fcollision()
  37.                 Case 3
  38.                     Fdrawimages()
  39.                     Text 320,240,"YOU LOST!!",1,1
  40.         End Select
  41.  Flip
  42. Wend
  43.  
  44. End
  45.  
  46. Function Fdrawimages()
  47.  
  48. TileImage(backgroundimage,backgroundXpos,0)
  49. DrawImage(hinderImage,hinderXpos,hinderYpos)
  50. DrawImage(heliImage,heliXpos,heliYpos)
  51. DrawImage(bulletImage,bulletXpos,bulletYpos)
  52.  
  53.  
  54. End Function
  55.  
  56. Function Fmoveimages()
  57.  
  58. backgroundXpos = backgroundXpos - 5
  59. If backgroundXpos = -640 Then backgroundXpos = 0
  60.  
  61. hinderXpos = hinderXpos - 10
  62. hinderYpos = hinderYpos = 3
  63. If hinderXpos = -1900 Then hinderXpos = 640
  64. If hinderYpos > 480 Then hinderYpos = 480
  65. End Function
  66.  
  67. Function Fflycopter()
  68.  
  69. If KeyDown(203) Then heliXpos = heliXpos - 5
  70. If KeyDown(205) Then heliXpos = heliXpos + 5
  71. If MouseDown(1) Then
  72.         heliYpos = heliYpos - 5
  73. Else
  74.         heliYpos = heliYpos + 10
  75.  
  76.  
  77. If heliXpos < -15 Then heliXpos = -14
  78. If heliXpos > 452 Then heliXpos = 453
  79. If heliYpos > 40 Then heliYpos = 39
  80.  
  81. End If
  82.  
  83. End Function
  84.  
  85. Function Fcollision()
  86.  
  87. If ImagesCollide(heliImage,heliXpos,heliYpos,0,hinderImage,hinderXpos,hinderYpos,0) Then stage = 3
  88.  
  89. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement