コード例 #1
0
ファイル: Asteroid.py プロジェクト: pmargani/pmarganiGameLib
 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
ファイル: Asteroid.py プロジェクト: pmargani/pmarganiGameLib
 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
ファイル: Hoik.py プロジェクト: EinarKristoffersen/Python
 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
ファイル: Food.py プロジェクト: EinarKristoffersen/Python
 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
ファイル: Boid.py プロジェクト: EinarKristoffersen/Python
 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
ファイル: Obstacle.py プロジェクト: EinarKristoffersen/Python
 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))