CONST Blue
= &HFF0000FF~&
' _RGB32(0,0,255) CONST Brown
= &HFFA52A2A~&
' _RGB32(165,42,42) CONST BrickRed
= &HFFCB4154~&
'_RGB32(203,65,84) CONST SkyBlue
= &HFF87CEEB~&
' _RGB32(135,206,235)
LINE (0, 479)-(639, 460), Brown
, BF
PCOPY 0, 1 'Save as the background x = 290
ROF = 50
Ammo = 1000
x = x - 3
x = x + 3
GenerateBall
DrawBalls
DrawPlayer x
DrawBullets
DrawStatus
Ball(i).x = Ball(i).x - Ball(i).movex
Ball(i).y = Ball(i).y - Ball(i).movey
IF Ball
(i
).x
< Ball
(i
).size
THEN Ball
(i
).x
= Ball
(i
).size: Ball
(i
).movex
= -Ball
(i
).movex
IF Ball
(i
).y
< -Ball
(i
).size
THEN Ball
(i
).y
= -Ball
(i
).size: Ball
(i
).movey
= -Ball
(i
).movey
IF Ball
(i
).x
> 640 - Ball
(i
).size
THEN Ball
(i
).x
= 640 - Ball
(i
).size: Ball
(i
).movex
= -Ball
(i
).movex
IF Ball
(i
).y
> 460 - Ball
(i
).size
THEN Ball
(i
).y
= 460 - Ball
(i
).size: Ball
(i
).movey
= -Ball
(i
).movey
CircleFill Ball
(i
).x
, Ball
(i
).y
, Ball
(i
).size
, _RGB32(0, 0, 255 - i
* 2)
StartTime = ExtendedTimer
IF ExtendedTimer
> Spawn
+ SpawnTime
THEN Spawn = ExtendedTimer
Ball(i).valid = -1
Ball
(i
).x
= RND * 640 + 1 Ball
(i
).size
= RND * 91 + 10 Ball(i).y = -Ball(i).size
Ball(i).originalsize = Ball(i).size
Ball
(i
).movey
= -RND * 3 + 1 Ball
(i
).movex
= 1 - RND * 3
FOR x1
= x
+ 10 TO x
+ 59 FOR x1
= x
+ 30 TO x
+ 39 LINE (x
+ 10, 425)-STEP(50, 20), Red
, BF
LINE (x
+ 30, 415)-STEP(10, 10), Red
, BF
Bullet(i).y = Bullet(i).y - 1
P
= POINT(Bullet
(i
).x
, Bullet
(i
).y
) Bullet(i).valid = 0
Ball(B).size = Ball(B).size - 1: score = score + 1
IF Ball
(B
).size
< 10 THEN Ball
(B
).valid
= 0: Ammo
= Ammo
+ Ball
(B
).originalsize
LINE (Bullet
(i
).x
, Bullet
(i
).y
)-STEP(3, 5), BrickRed
, BF
GameOver = -1 'once you're out of bullets and there's none left on the screen, the game is over.
IF ExtendedTimer
> Delay
+ ROF
/ 1000 THEN 'only shoot once every Rate Of Fire Bullet(i).valid = -1
Bullet(i).x = x + 33
Bullet(i).y = 410
Ammo = Ammo - 1
Delay = ExtendedTimer
l1
= INSTR(l
+ 1, d$
, "-") SELECT CASE i
'Add the number of days for each previous month passed CASE 1: d
= d
'January doestn't have any carry over days. CASE 2, 4, 6, 8, 9, 11: d
= d
+ 31 CASE 5, 7, 10, 12: d
= d
+ 30 d = d + 365
IF m
> 2 THEN d
= d
+ 1 'add an extra day for leap year every 4 years, starting in 2016 s~&& = d * 24 * 60 * 60 'Seconds are days * 24 hours * 60 minutes * 60 seconds
ExtendedTimer##
= (s~&&
+ TIMER)
' CX = center x coordinate
' CY = center y coordinate
' R = radius
' C = fill color
RadiusError = -Radius
X = Radius
Y = 0
LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF