Drop. Drop. Drop. goes the asteroids
Posted: Mon Jan 27, 2014 8:07 pm
Code: Select all
import math
def xfrange(start, stop, step):
while start < stop:
yield start
start += step
#"Stolen" from http://stackoverflow.com/questions/4189766/python-range-with-step-of-type-float
output = "Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0]"
time = 1000
step = 40
start = 200
xv = 5
yv = 0
for a in xfrange(start,start+time,step):
output = output + ", [x0: 0,y0: 0,vx: " + str(xv) + ",vy: " + str(yv) + ",t0: " + str(a) + ",who: 3,m: 0]"
print output
Example:
Code: Select all
Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 200,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 240,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 280,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 320,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 360,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 400,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 440,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 480,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 520,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 560,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 600,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 640,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 680,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 720,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 760,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 800,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 840,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 880,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 920,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 960,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1000,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1040,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1080,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1120,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1160,who: 3,m: 0]
This can be eerily organic:
Code: Select all
Gravity Fun at TestTubeGames: [ForceG: -2,Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 33,y0: 64,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 65,y0: -12,vx: 0,vy: 0,t0: 0,who: 1,m: 1000], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 200,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 240,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 280,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 320,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 360,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 400,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 440,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 480,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 520,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 560,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 600,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 640,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 680,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 720,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 760,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 800,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 840,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 880,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 920,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 960,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1000,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1040,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1080,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1120,who: 3,m: 0], [x0: 0,y0: 0,vx: 5,vy: 0,t0: 1160,who: 3,m: 0]