diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-06-11 00:52:01 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-06-11 00:52:01 +0000 |
commit | e9c53b3a4f3fd89176a34e8bd4aa527b51ca89ff (patch) | |
tree | 33cda4c01fbaeea75a11376e89bc68573fa03ad1 /gametypes.bmx | |
parent | 88d280bb46d7557a06d2ab0342e42896549c7f9a (diff) |
Added twinkling stars and starting level options
Diffstat (limited to 'gametypes.bmx')
-rw-r--r-- | gametypes.bmx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gametypes.bmx b/gametypes.bmx index 7956568..1e5fb54 100644 --- a/gametypes.bmx +++ b/gametypes.bmx @@ -169,10 +169,12 @@ Type BackdropStar Field r:Int Field g:Int Field b:Int + Field twinkle:Int + Field frame:Int Method New() x=Rand(0,800) - y=Rand(0,600) + y=Rand(0,598) r=Rand(128,255) g=Rand(128,255) b=Rand(128,255) @@ -183,19 +185,36 @@ End Type Type Backdrop Const NUM:Int=100 Global s:BackdropStar[] + Global frame:Int Function Init() s=New BackdropStar[NUM] For Local f:Int=0 Until NUM s[f]=New BackdropStar + s[f].frame=f Mod 6 + s[f].twinkle=Rand(100)>70 Next + + frame=0 End Function Function Draw() + frame=(frame+1) Mod 6 For Local f:Int=0 Until NUM SetColor(s[f].r,s[f].g,s[f].b) - DrawImage(GFX.star,s[f].x,s[f].y) + If s[f].twinkle + DrawImage(GFX.twinkle,s[f].x,s[f].y,s[f].frame) + If Not frame + s[f].frame=(s[f].frame+1) Mod 6 + s[f].x=(s[f].x+2) Mod 800 + EndIf + Else + DrawImage(GFX.star,s[f].x,s[f].y) + If Not frame + s[f].x=(s[f].x+1) Mod 800 + EndIf + EndIf Next End Function End Type |