Exemplo n.º 1
0
	def update(self, time_elapsed, events):
		Game_Object.update(self, time_elapsed, events)

		time_elapsed /= 1000.0	#convert [ms] to [s]

		self.x_vel += (self.x_acc * time_elapsed)
		self.y_vel += (self.y_acc * time_elapsed)
Exemplo n.º 2
0
	def __init__( self              ,
	              loc  = (0.0, 0.0) ,
	              vel  = (0.0, 0.0) ,
	              acc  = (0.0, 0.0) ,
	              size = (50, 50)   ,
	              mass = 1          ,
	              spin = 0	        ):	
		# super
		Game_Object.__init__(self, loc, vel, size)

		# mass
		self.mass  = mass

		#spin 
		self.spin = spin

		# acceleration
		self.x_acc = acc[0]
		self.y_acc = acc[1]

		# gravity
		self.GRAVITY = 10 * (6.67e-11)