예제 #1
0
 def __init__(self, name, x, y, radius, theta):
     Circle.__init__(self, name, radius, (250, 250, 0), x, y) 
     self.theta = theta
     self.speed = 20.
     self.vX = self.speed * cos(self.theta)
     self.vY = self.speed * sin(self.theta)
     self.theta = theta
예제 #2
0
 def __init__(self, name, x, y, radius, theta):
     Circle.__init__(self, name, radius, (250, 250, 0), x, y)
     self.theta = theta
     self.speed = 20.
     self.vX = self.speed * cos(self.theta)
     self.vY = self.speed * sin(self.theta)
     self.theta = theta
예제 #3
0
파일: Star.py 프로젝트: rrydman/Asteroids
 def __init__(self):
     (x,y) = random.randint(0, config.SCREEN_X), random.randint(0, config.SCREEN_Y)
     position = Point(x,y)
     rand = random.randint(0,255)
     color = (rand,rand,rand)
     radius = config.STAR_RADIUS
     rotation = 0.0
     Circle.__init__(self, position, radius, rotation, color)
예제 #4
0
 def __init__(self, pos=None):
     Circle.__init__(self, C.HOIK_RADIUS, C.HOIK_COLOR, 2)
     self.velocity = C.HOIK_VELOCITY
     self.dir = Vector(random.randint(-10, 10),random.randint(-10, 10)).normalized() * self.velocity
    
     if pos == None:
         self.pos = Vector(random.randint(0, C.SCREEN_SIZE.x), random.randint(0, C.SCREEN_SIZE.y))
     else:
         self.pos = pos
예제 #5
0
 def __init__(self):
     (x, y) = random.randint(0, config.SCREEN_X), random.randint(
         0, config.SCREEN_Y)
     position = Point(x, y)
     rand = random.randint(0, 255)
     color = (rand, rand, rand)
     radius = config.STAR_RADIUS
     rotation = 0.0
     Circle.__init__(self, position, radius, rotation, color)
예제 #6
0
 def __init__(self, x, y, r, port='COM13', baudrate=115200):  # parent
     threading.Thread.__init__(self)  # super class constructor
     self.daemon = True  # set to True so that this thread stops when the process stops
     Circle.__init__(self, -1, x, y, r)  # super class constructor
     self.img = Circle.CIRCLE_IMG_GREY
     self.portNumber = port
     self.baudrate = baudrate
     self.running = True
     self.ser = None
     self.startTime = 0
     self.connected = False
     self.color = Tool.COLOR
     self.target = None  # the current target circle
     self.logging = False
     self.timingFunc = None
     self.pedalPressCount = 0
예제 #7
0
파일: Bullet.py 프로젝트: adirksen/Python
 def __init__(self, position, radius, rotation, color): 
     Circle.__init__(self, position, radius, rotation, color)
     self.set_inactive()
예제 #8
0
 def __init__(self, height, radius, color):
     Circle.__init__(self, radius, color)
     self.height = height
예제 #9
0
 def __init__(self):
     Circle.__init__(self, C.FOOD_RADIUS, C.FOOD_COLOR, None)
     self.pos = Vector(random.randint(0, C.SCREEN_SIZE.x), random.randint(0, C.SCREEN_SIZE.y))
예제 #10
0
파일: Bullet.py 프로젝트: rrydman/Asteroids
 def __init__(self, position, radius, rotation, color): 
     Circle.__init__(self, position, radius, rotation, color)
     self.set_inactive()
예제 #11
0
 def __init__(self, x, y, connection):
     Circle.__init__(self, x, y, 100)
     self.connection = connection
예제 #12
0
 def __init__(self):
     Circle.__init__(self, C.BOID_RADIUS, C.BOID_COLOR, None)
     self.pos = Vector(random.randint(0, C.SCREEN.get_width()), random.randint(0, C.SCREEN.get_height()))
     self.velocity = C.BOID_VELOCITY
     self.dir = Vector(random.randint(-10, 10),random.randint(-10, 10)).normalized() * self.velocity
예제 #13
0
 def __init__(self):
     radius = random.randint(C.OBSTACLE_RADIUS_MIN, C.OBSTACLE_RADIUS_MAX)
     Circle.__init__(self, radius, C.OBSTACLE_COLOR, None)
     self.pos = Vector(random.randint(0, C.SCREEN_SIZE.x), random.randint(0, C.SCREEN_SIZE.y))