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
|
||||
20 TS = 40
|
||||
30 DIM DX(9),DY(9),C(9),X(9),Y(9)
|
||||
1000 DX(0) = 19
|
||||
1005 DY(0) = 0
|
||||
1010 C(0) = 7
|
||||
1100 DX(1) = -8
|
||||
1105 DY(1) = -17
|
||||
1110 C(1) = 9
|
||||
1200 DX(2) = -14
|
||||
1205 DY(2) = -13
|
||||
1210 C(2) = 12
|
||||
1300 DX(3) = -12
|
||||
1305 DY(3) = 15
|
||||
1310 C(3) = 5
|
||||
1400 DX(4) = -12
|
||||
1405 DY(4) = 15
|
||||
1410 C(4) = 12
|
||||
1500 DX(5) = 19
|
||||
1505 DY(5) = 5
|
||||
1510 C(5) = 13
|
||||
1600 DX(6) = 19
|
||||
1605 DY(6) = -1
|
||||
1610 C(6) = 5
|
||||
1700 DX(7) = 9
|
||||
1705 DY(7) = 17
|
||||
1710 C(7) = 14
|
||||
1800 DX(8) = -12
|
||||
1805 DY(8) = 15
|
||||
1810 C(8) = 5
|
||||
1900 DX(9) = 10
|
||||
1905 DY(9) = 16
|
||||
1910 C(9) = 13
|
||||
2100 T = 0
|
||||
30 DIM DX(9),DY(9),C(9),X(9),Y(9),T(9)
|
||||
1000 DX(0) = 12
|
||||
1005 DY(0) = 15
|
||||
1010 C(0) = 6
|
||||
1015 T(0) = 10
|
||||
1100 DX(1) = 19
|
||||
1105 DY(1) = 0
|
||||
1110 C(1) = 5
|
||||
1115 T(1) = 9
|
||||
1200 DX(2) = -19
|
||||
1205 DY(2) = -1
|
||||
1210 C(2) = 9
|
||||
1215 T(2) = 9
|
||||
1300 DX(3) = -19
|
||||
1305 DY(3) = 3
|
||||
1310 C(3) = 1
|
||||
1315 T(3) = 32
|
||||
1400 DX(4) = -1
|
||||
1405 DY(4) = 19
|
||||
1410 C(4) = 7
|
||||
1415 T(4) = 27
|
||||
1500 DX(5) = -12
|
||||
1505 DY(5) = -15
|
||||
1510 C(5) = 12
|
||||
1515 T(5) = 3
|
||||
1600 DX(6) = -19
|
||||
1605 DY(6) = -2
|
||||
1610 C(6) = 7
|
||||
1615 T(6) = 18
|
||||
1700 DX(7) = 17
|
||||
1705 DY(7) = 9
|
||||
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
|
||||
2210 OX = X(I) : OY = Y(I)
|
||||
2220 X(I) = 20 + DX(I) * T / TS
|
||||
2230 Y(I) = 20 + DY(I) * T / TS
|
||||
2220 X(I) = 20 + DX(I) * T(I) / 40
|
||||
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
|
||||
2250 COLOR=C(I) : PLOT X(I), Y(I)
|
||||
2260 I = I + 1 : IF I < 10 GOTO 2210
|
||||
2300 T = T + 1 : IF T = TS THEN T = 0
|
||||
2310 GOTO 2200
|
||||
2300 GOTO 2200
|
||||
|
@ -3,26 +3,29 @@ import math
|
||||
|
||||
str = """%(init)d00 DX(%(which)d) = %(x)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 "20 TS = 40"
|
||||
print "30 DIM DX(9),DY(9),C(9),X(9),Y(9)"
|
||||
print "20 TS = %d" % ts
|
||||
print "30 DIM DX(9),DY(9),C(9),X(9),Y(9),T(9)"
|
||||
|
||||
for i in range(0,10) :
|
||||
angle = random.uniform(0,.999)
|
||||
x = int(20 * math.cos(angle * 3.14159 * 2))
|
||||
y = int(20 * math.sin(angle * 3.14159 * 2))
|
||||
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 "2210 OX = X(I) : OY = Y(I)"
|
||||
print "2220 X(I) = 20 + DX(I) * T / TS"
|
||||
print "2230 Y(I) = 20 + DY(I) * T / TS"
|
||||
print "2220 X(I) = 20 + DX(I) * T(I) / %d" % 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 "2250 COLOR=C(I) : PLOT X(I), Y(I)"
|
||||
print "2260 I = I + 1 : IF I < 10 GOTO 2210"
|
||||
print "2300 T = T + 1 : IF T = TS THEN T = 0"
|
||||
print "2310 GOTO 2200"
|
||||
print "2300 GOTO 2200"
|
||||
|
Loading…
Reference in New Issue
Block a user