From e9c53b3a4f3fd89176a34e8bd4aa527b51ca89ff Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 11 Jun 2006 00:52:01 +0000 Subject: Added twinkling stars and starting level options --- gametypes.bmx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'gametypes.bmx') 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 -- cgit v1.2.3