green = (0, 155, 0)

#ALl Variables
width = 600
circleRadius = 30

bigCircleRadius = 100

#All Vectors:
# position = vector.create('position',200,200)
# velocity = vector.create('velocity',0,0)
# vector.setLength(velocity,3)
# vector.setAngle(velocity,(math.pi/6))
#Creating a Particle:

particle = (p.create(100, 100, 3, (math.pi / 6)))
particlePosition = vector.toInt(particle[0])
particleVelocity = vector.toInt(particle[1])
particle = [particlePosition, particleVelocity]
print(particlePosition, particleVelocity)
speed = 0

pg.init()
mainDisplay = pg.display.set_mode((width, width))
pg.display.set_caption("Ball Movement")
frames = pg.time.Clock()
pause = True


def update():
    mainDisplay.fill(white)
colors = [black,blue,green,red]

#ALl Variables
width = 600
circleRadius = 30

bigCircleRadius = 100

#All Vectors:
# position = vector.create('position',200,200)
# velocity = vector.create('velocity',0,0)
# vector.setLength(velocity,3)
# vector.setAngle(velocity,(math.pi/6))
#Creating a Particle:
ship = p.create(width/2,width/2,1,1,1)

thrust = vector.create('thrust',0,0)



speed = 0


pg.init()
mainDisplay = pg.display.set_mode((width,width))
pg.display.set_caption("Ball Movement")
frames = pg.time.Clock()
pause = True

Beispiel #3
0
import random
import vectorOperationFunctions as vector
import particleFunctions as p
black = (0, 0, 0)
white = (255, 255, 255)
blue = (0, 0, 255)
red = (255, 0, 0)
green = (0, 155, 0)

colors = [black, blue, green, red]

#ALl Variables
width = 600
circleRadius = 30

sun = p.create(width / 2, width / 2, 0, 0, 0)
planet = p.create(width / 2 + 200, width / 2, 10, -math.pi / 2, 0)
planetPosition = planet[0]
planetVelocity = planet[1]
sunPosition = sun[0]
sunVelocity = sun[1]

sunMass = 20000

speed = 0

pg.init()
mainDisplay = pg.display.set_mode((width, width))
pg.display.set_caption("Ball Movement")
frames = pg.time.Clock()
pause = True
Beispiel #4
0
green = (0, 155, 0)

#ALl Variables
width = 600
circleRadius = 30

bigCircleRadius = 100

#All Vectors:
# position = vector.create('position',200,200)
# velocity = vector.create('velocity',0,0)
# vector.setLength(velocity,3)
# vector.setAngle(velocity,(math.pi/6))
#Creating a Particle:

particle = (p.create(100, width, 10, (-math.pi / 2)))
particleAcceleration = vector.create('accelerationVector', 0.1, 0.1)
particlePosition = vector.toInt(particle[0])
particleVelocity = vector.toInt(particle[1])
particle = [particlePosition, particleVelocity]
print(particlePosition, particleVelocity)
speed = 0

pg.init()
mainDisplay = pg.display.set_mode((width, width))
pg.display.set_caption("Ball Movement")
frames = pg.time.Clock()
pause = True


def update():
Beispiel #5
0
#All Vectors:
# position = vector.create('position',200,200)
# velocity = vector.create('velocity',0,0)
# vector.setLength(velocity,3)
# vector.setAngle(velocity,(math.pi/6))
#Creating a Particle:
particles = []

numParticles = 50
for x in range(0, numParticles):
    randomPositionX = random.randint(0, numParticles)
    randomPositionY = random.randint(0, numParticles)
    randomVelocity = random.randint(0, 50)
    particles.append(
        p.create(randomPositionX, randomPositionY, randomVelocity,
                 (math.pi / 6)))
    particlePosition = vector.toInt(particles[x][0])
    particleVelocity = vector.toInt(particles[x][1])
    particles[x] = [particlePosition, particleVelocity]

print(particles)
speed = 0

pg.init()
mainDisplay = pg.display.set_mode((width, width))
pg.display.set_caption("Ball Movement")
frames = pg.time.Clock()
pause = True


def update():