Hello everyone! This is my first game in Blitz3D. Remember it is not commercial quality. The point of this game is to move your cyclops left and right. You then want to shoot the coins with your coin bag to gain points. If you miss the coins, you lose points. If the coins go behind you, you lose lives. Tell me what you guys think. :)
Download for the game: http://www.megaupload.com/?d=XLJMP83Q
Graphics 640,400
;constant variables that won't change
Const uparrow = 200
Const downarrow = 208
Const leftkey = 203
Const rightkey = 205
Const spacebar = 57
;______________Images-----------------
Global stickmancyclops = LoadImage("StickmanCyclops.bmp");the stickman cyclops himself...
MaskImage stickmancyclops,0,0,0
Global CoinBagImage = LoadImage("coinbag.bmp")
MaskImage CoinBagImage,0,0,0
Global CoinImage = LoadImage("coin.bmp")
MaskImage CoinImage,0,0,0
;______________Types------------------
Type CyclopsType
Field x,y
End Type
Type CoinBagType
Field x,y
End Type
Type CoinType
Field x#,y#
End Type
;------------------------------------
Global cyclops.CyclopsType = New CyclopsType
cyclops\x = 260
cyclops\y = 300
Global coinspeed# = 0.5
Global CoinSpawnRate# = 0
Global Level = 1
Global LevelGap = 20000
Global NextLevel= MilliSecs() + LevelGap
Global Points = 0
Global Lives = 3
SetBuffer BackBuffer()
SeedRnd MilliSecs
;--------------------MAIN LOOP---------------------
While Not KeyDown(1)
If MilliSecs() > NextLevel
NextLevel = MilliSecs() + LevelGap
Level = Level + 1
coinspeed = coinspeed + 0.5
EndIf
CoinSpawnRate = CoinSpawnRate + 2
If Lives <= 0
Print "YOU LOSE!"
Delay 5000
End
EndIf
Cls
Text 550,15,"Lives:" + Lives
Text 550,0,"Points:" + Points
DrawImage stickmancyclops,cyclops\x,cyclops\y
MoveCyclops();the function that moves the stickman cyclops...
CreateCoinBagandCoins();function which creates the balls
UpdateCoinBagandCoins();function which updates the balls once they're created
Flip
Wend
;-------------END OF MAIN LOOP----------------
Function MoveCyclops();moves the STICKMAN CYCLOPS!
If KeyDown(leftkey) Then cyclops\x = cyclops\x - 7
If KeyDown(rightkey) Then cyclops\x = cyclops\x + 7
End Function
;FUNCTION WHICH CREATES THE BULLETS AND BLOCKS
Function CreateCoinBagandCoins()
If KeyHit(spacebar)
coinbag.coinbagType = New CoinBagType
coinbag\x = cyclops\x + 50
coinbag\y = cyclops\y + 18
EndIf
If CoinSpawnRate >= 120
coin.coinType = New CoinType
coin\x# = Rand(3,550)
coin\y# = Rand(3,150)
EndIf
If CoinSpawnRate >= 120 Then CoinSpawnRate = 0
End Function
;FUNCTION WHICH UPDATES THE BULLETS AND BALLS
Function UpdateCoinBagandCoins()
For coinbag.coinbagType = Each CoinBagType
coinbag\y = coinbag\y - 4
DrawImage CoinBagImage,coinbag\x,coinbag\y
For coin.cointype = Each CoinType
If ImagesOverlap(CoinImage,coin\x,coin\y,CoinBagImage,coinbag\x,coinbag\y)
Delete coin
Delete coinbag
Points = Points + 1
Exit
EndIf
Next
If coinbag <> Null
If coinbag\y < -12 Then Points = Points - 1
If coinbag\y < -12 Then Delete coinbag
EndIf
Next
For coin.cointype = Each CoinType
coin\y = coin\y + coinspeed
DrawImage CoinImage,coin\x,coin\y
If coin\y > 400
Lives = Lives - 1
Delete coin
EndIf
Next
End Function
Last edited 2011
|