Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Graphics 640,480,0,2
- SetBuffer BackBuffer()
- Global backgroundimage = LoadImage("background.bmp")
- Global backgroundXpos = 0
- Global heliImage = LoadImage("helicopter.bmp")
- Global heliXpos = 50
- Global heliYpos = 120
- Global hinderImage = LoadImage("hinder.bmp")
- Global hinderXpos = 0
- Global hinderYpos = 0
- Global bulletImage = LoadImage("C:\Users\Sanna_2\Desktop\helicopter\bullet.bmp")
- Global stage = 1
- While Not KeyHit(1)
- Cls
- Select stage
- Case 1
- Fdrawimages()
- Ferror()
- Text 320,240,"press Enter to begin flying",1,1
- If KeyHit(28) Then stage = 2
- Case 2
- Fdrawimages()
- Fmoveimages()
- Fflycopter()
- Fcollision()
- Case 3
- Fdrawimages()
- Text 320,240,"YOU LOST!!",1,1
- End Select
- Flip
- Wend
- End
- Function Fdrawimages()
- TileImage(backgroundimage,backgroundXpos,0)
- DrawImage(hinderImage,hinderXpos,hinderYpos)
- DrawImage(heliImage,heliXpos,heliYpos)
- DrawImage(bulletImage,50,50)
- End Function
- Function Fmoveimages()
- backgroundXpos = backgroundXpos - 5
- If backgroundXpos = -640 Then backgroundXpos = 0
- hinderXpos = hinderXpos - 10
- hinderYpos = hinderYpos = 3
- If hinderXpos = -1900 Then hinderXpos = 640
- If hinderYpos > 480 Then hinderYpos = 480
- End Function
- Function Fflycopter()
- If KeyDown(203) Then heliXpos = heliXpos - 5
- If KeyDown(205) Then heliXpos = heliXpos + 5
- If MouseDown(1) Then
- heliYpos = heliYpos - 5
- Else
- heliYpos = heliYpos + 10
- If heliXpos < -15 Then heliXpos = -14
- If heliXpos > 452 Then heliXpos = 453
- If heliYpos > 40 Then heliYpos = 39
- End If
- End Function
- Function Fcollision()
- If ImagesCollide(heliImage,heliXpos,heliYpos,0,hinderImage,hinderXpos,hinderYpos,0) Then stage = 3
- End Function
- Function Ferror()
- If Not bulletImage Then DebugLog "Nope!"
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement