Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2012
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  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 bullet = LoadImage("bullet.bmp")
  16. Global bulletXpos = 0
  17. Global bulletYpos = -5
  18.  
  19. Global stage = 1
  20.  
  21. While Not KeyHit(1)
  22. Cls
  23. Select stage
  24. Case 1
  25. Fdrawimages()
  26. Text 320,240,"press Enter to begin flying",1,1
  27. Text 320,220,"håll i vänster musknapp för att flyga uppåt",1,1
  28. Text 320,200,"flyg framåt eller bakåt med vänster/höger pil",1,1
  29. If KeyHit(28) Then stage = 2
  30. Case 2
  31. Fdrawimages()
  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(bullet,bulletXpos,bulletYpos)
  50.  
  51. End Function
  52.  
  53. Function Fmoveimages()
  54.  
  55. backgroundXpos = backgroundXpos - 5
  56. If backgroundXpos = -640 Then backgroundXpos = 0
  57.  
  58. hinderXpos = hinderXpos - 10
  59. hinderYpos = hinderYpos = 3
  60. If hinderXpos = -1900 Then hinderXpos = 640
  61. If hinderYpos > 480 Then hinderYpos = 480
  62. End Function
  63.  
  64. Function Fflycopter()
  65.  
  66. If KeyDown(203) Then heliXpos = heliXpos - 5
  67. If KeyDown(205) Then heliXpos = heliXpos + 5
  68. If MouseDown(1) Then
  69. heliYpos = heliYpos - 5
  70. Else
  71. heliYpos = heliYpos + 10
  72. End If
  73.  
  74. If heliXpos < -15 Then heliXpos = -14
  75. If heliXpos > 452 Then heliXpos = 453
  76.  
  77. End Function
  78.  
  79. Function Fcollision()
  80.  
  81. If ImagesCollide(heliImage,heliXpos,heliYpos,0,hinderImage,hinderXpos,hinderYpos,0) Then stage = 3
  82.  
  83. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement