mirror of
https://github.com/bradgrantham/apple2a.git
synced 2024-11-27 03:49:31 +00:00
add a time delta so stars are staggered
This commit is contained in:
parent
fa8439f2ec
commit
fae94825ce
@ -1,43 +1,52 @@
|
|||||||
10 GR
|
10 GR
|
||||||
20 TS = 40
|
20 TS = 40
|
||||||
30 DIM DX(9),DY(9),C(9),X(9),Y(9)
|
30 DIM DX(9),DY(9),C(9),X(9),Y(9),T(9)
|
||||||
1000 DX(0) = 19
|
1000 DX(0) = 12
|
||||||
1005 DY(0) = 0
|
1005 DY(0) = 15
|
||||||
1010 C(0) = 7
|
1010 C(0) = 6
|
||||||
1100 DX(1) = -8
|
1015 T(0) = 10
|
||||||
1105 DY(1) = -17
|
1100 DX(1) = 19
|
||||||
1110 C(1) = 9
|
1105 DY(1) = 0
|
||||||
1200 DX(2) = -14
|
1110 C(1) = 5
|
||||||
1205 DY(2) = -13
|
1115 T(1) = 9
|
||||||
1210 C(2) = 12
|
1200 DX(2) = -19
|
||||||
1300 DX(3) = -12
|
1205 DY(2) = -1
|
||||||
1305 DY(3) = 15
|
1210 C(2) = 9
|
||||||
1310 C(3) = 5
|
1215 T(2) = 9
|
||||||
1400 DX(4) = -12
|
1300 DX(3) = -19
|
||||||
1405 DY(4) = 15
|
1305 DY(3) = 3
|
||||||
1410 C(4) = 12
|
1310 C(3) = 1
|
||||||
1500 DX(5) = 19
|
1315 T(3) = 32
|
||||||
1505 DY(5) = 5
|
1400 DX(4) = -1
|
||||||
1510 C(5) = 13
|
1405 DY(4) = 19
|
||||||
1600 DX(6) = 19
|
1410 C(4) = 7
|
||||||
1605 DY(6) = -1
|
1415 T(4) = 27
|
||||||
1610 C(6) = 5
|
1500 DX(5) = -12
|
||||||
1700 DX(7) = 9
|
1505 DY(5) = -15
|
||||||
1705 DY(7) = 17
|
1510 C(5) = 12
|
||||||
1710 C(7) = 14
|
1515 T(5) = 3
|
||||||
1800 DX(8) = -12
|
1600 DX(6) = -19
|
||||||
1805 DY(8) = 15
|
1605 DY(6) = -2
|
||||||
1810 C(8) = 5
|
1610 C(6) = 7
|
||||||
1900 DX(9) = 10
|
1615 T(6) = 18
|
||||||
1905 DY(9) = 16
|
1700 DX(7) = 17
|
||||||
1910 C(9) = 13
|
1705 DY(7) = 9
|
||||||
2100 T = 0
|
1710 C(7) = 13
|
||||||
|
1715 T(7) = 7
|
||||||
|
1800 DX(8) = -19
|
||||||
|
1805 DY(8) = 1
|
||||||
|
1810 C(8) = 10
|
||||||
|
1815 T(8) = 5
|
||||||
|
1900 DX(9) = 18
|
||||||
|
1905 DY(9) = 8
|
||||||
|
1910 C(9) = 1
|
||||||
|
1915 T(9) = 9
|
||||||
2200 I = 0
|
2200 I = 0
|
||||||
2210 OX = X(I) : OY = Y(I)
|
2210 OX = X(I) : OY = Y(I)
|
||||||
2220 X(I) = 20 + DX(I) * T / TS
|
2220 X(I) = 20 + DX(I) * T(I) / 40
|
||||||
2230 Y(I) = 20 + DY(I) * T / TS
|
2230 Y(I) = 20 + DY(I) * T(I) / 40
|
||||||
|
2235 T(I) = T(I) + 1 : IF T(I) = TS THEN T(I) = 0
|
||||||
2240 COLOR=0 : PLOT OX, OY
|
2240 COLOR=0 : PLOT OX, OY
|
||||||
2250 COLOR=C(I) : PLOT X(I), Y(I)
|
2250 COLOR=C(I) : PLOT X(I), Y(I)
|
||||||
2260 I = I + 1 : IF I < 10 GOTO 2210
|
2260 I = I + 1 : IF I < 10 GOTO 2210
|
||||||
2300 T = T + 1 : IF T = TS THEN T = 0
|
2300 GOTO 2200
|
||||||
2310 GOTO 2200
|
|
||||||
|
@ -3,26 +3,29 @@ import math
|
|||||||
|
|
||||||
str = """%(init)d00 DX(%(which)d) = %(x)d
|
str = """%(init)d00 DX(%(which)d) = %(x)d
|
||||||
%(init)d05 DY(%(which)d) = %(y)d
|
%(init)d05 DY(%(which)d) = %(y)d
|
||||||
%(init)d10 C(%(which)d) = %(c)d"""
|
%(init)d10 C(%(which)d) = %(c)d
|
||||||
|
%(init)d15 T(%(which)d) = %(t)d"""
|
||||||
|
|
||||||
|
ts = 40
|
||||||
|
|
||||||
print "10 GR"
|
print "10 GR"
|
||||||
print "20 TS = 40"
|
print "20 TS = %d" % ts
|
||||||
print "30 DIM DX(9),DY(9),C(9),X(9),Y(9)"
|
print "30 DIM DX(9),DY(9),C(9),X(9),Y(9),T(9)"
|
||||||
|
|
||||||
for i in range(0,10) :
|
for i in range(0,10) :
|
||||||
angle = random.uniform(0,.999)
|
angle = random.uniform(0,.999)
|
||||||
x = int(20 * math.cos(angle * 3.14159 * 2))
|
x = int(20 * math.cos(angle * 3.14159 * 2))
|
||||||
y = int(20 * math.sin(angle * 3.14159 * 2))
|
y = int(20 * math.sin(angle * 3.14159 * 2))
|
||||||
c = random.randrange(1,15)
|
c = random.randrange(1,15)
|
||||||
print str % {'init' : 10 + i, 'x' : x, 'y' : y, 'c' : c, 'which' : i}
|
t = random.randrange(0,ts - 1)
|
||||||
|
print str % {'init' : 10 + i, 'x' : x, 'y' : y, 'c' : c, 'which' : i, 't' : t}
|
||||||
|
|
||||||
print "2100 T = 0"
|
|
||||||
print "2200 I = 0"
|
print "2200 I = 0"
|
||||||
print "2210 OX = X(I) : OY = Y(I)"
|
print "2210 OX = X(I) : OY = Y(I)"
|
||||||
print "2220 X(I) = 20 + DX(I) * T / TS"
|
print "2220 X(I) = 20 + DX(I) * T(I) / %d" % ts
|
||||||
print "2230 Y(I) = 20 + DY(I) * T / TS"
|
print "2230 Y(I) = 20 + DY(I) * T(I) / %d" % ts
|
||||||
|
print "2235 T(I) = T(I) + 1 : IF T(I) = TS THEN T(I) = 0"
|
||||||
print "2240 COLOR=0 : PLOT OX, OY"
|
print "2240 COLOR=0 : PLOT OX, OY"
|
||||||
print "2250 COLOR=C(I) : PLOT X(I), Y(I)"
|
print "2250 COLOR=C(I) : PLOT X(I), Y(I)"
|
||||||
print "2260 I = I + 1 : IF I < 10 GOTO 2210"
|
print "2260 I = I + 1 : IF I < 10 GOTO 2210"
|
||||||
print "2300 T = T + 1 : IF T = TS THEN T = 0"
|
print "2300 GOTO 2200"
|
||||||
print "2310 GOTO 2200"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user