예제 #1
0
파일: Earth.py 프로젝트: gpjt/explorer
 def __init__(self, location, velocity):
     WorldObject.__init__(self, 5.9736 * 10 ** 24, location, velocity)
     self.radius = 6371
     self.rotationPeriod = 3600 * 24
     self.rotation = 0
     self.texture = LoadTexture("envisat-earth.jpg")
     self.name = "Earth"
예제 #2
0
	def __init__ (self,
			position,
			collision,
			imglist,
			animated,
			world,			
			frameDuration = 1,
			currentImg = None,
			imgAdjustV = 0,
			imgAdjustH = 0,
			visible=True,
			hsize=1,
			vsize=1,
			canHover=False,
			speed=[0,0],
			maxSpeed=0):
		
		WorldObject.__init__(self,
			position = position,
			collision = collision,
			imglist = imglist,
			animated = animated,
			world = world,
			frameDuration = frameDuration,
			currentImg = currentImg,
			imgAdjustV = imgAdjustV,
			imgAdjustH = imgAdjustH,
			hsize=hsize,
			vsize=vsize,
			visible = visible)
	
		self.speed = speed
		self.maxSpeed = maxSpeed

		self.updateCollisionBox()
예제 #3
0
 def move(self):
     WorldObject.move(self)
     self.rect.x = self.getPosX()
     self.rect.y = self.getPosY()
     self.health.setPosition(self.getPosX() - 5, self.getPosY() - 4)
     if self.__countMove == 24:
         self.__countMove = 0
     else:
         self.__countMove += 1
예제 #4
0
파일: Bot.py 프로젝트: dobrodeyJ/Survival
 def move(self):
     WorldObject.move(self)
     self.rect.x = self.getPosX()
     self.rect.y = self.getPosY()
     self.health.setPosition(self.getPosX() - 5, self.getPosY() - 4)
     if self.__countMove == 24:
         self.__countMove = 0
     else:
         self.__countMove += 1
예제 #5
0
 def __init__(self, location, velocity):
     WorldObject.__init__(self, 1000000, location, velocity)
     self.thrust = 0
     
     glPushMatrix()
     glLoadIdentity()
     glRotatef(180, 0, 1, 0)
     self.rotationMatrix = glGetFloatv(GL_MODELVIEW_MATRIX)
     glPopMatrix()
예제 #6
0
    def __init__(self, file=False):
        #calling parent method
        WorldObject.__init__(self)

        self.originalFilename = file
        self.placeholder = False
        self.locking = False

        if file != False:
            self.loadModel(file)
	def __init__(self,file = False):
		#calling parent method
		WorldObject.__init__(self)
		
		self.originalFilename = file
		self.placeholder = False
		self.locking = False
		
		if file != False:
			self.loadModel(file)
예제 #8
0
파일: Block.py 프로젝트: aapope/OpenGLMaze
 def __init__(self, position, color, obj_type="block"):
     """
     @type  position:  3-tuple (x, y, z)
     @param position:  Specifying the object's position
     @type  color:     3-tuple (R, G, B)
     @param color:     Specifying the color values
     @type  obj_type:  String        
     @param obj_type:  This WorldObject's type
     @return: Block
     """
     WorldObject.__init__(self, position, color, obj_type)  # format from ibiblio website
     # super(Block, self).__init__(self, position, color)        #format from lecture
     self.width = 1.2
예제 #9
0
파일: Chest.py 프로젝트: aapope/OpenGLMaze
 def __init__(self, position, points = 100, color = (255,255,0), obj_type = "chest"):
     '''
     @type  position:  3-tuple (x, y, z)
     @param position:  Specifying the object's position
     @type  color:     3-tuple (R, G, B)
     @param color:     Specifying the color values
     @type  obj_type:  String        
     @param obj_type:  This WorldObject's type
     @return:          A Chest object that inherits from WorldObject
     '''
     WorldObject.__init__(self, position, color, obj_type)                #format from ibiblio website
     #super(Block, self).__init__(self, position, color)        #format from lecture 
     self.points = 100
     self.width=1.5
     self.has = False
예제 #10
0
	def __init__(self,
			position,
			collision,
			imglist,
			animated,
			world,
			frameDuration=1,
			currentImg=None,
			visible=True):

		WorldObject.__init__(self,
				position=position,
				collision = collision,
				imglist = imglist,
				animated = animated,
				world = None,
				frameDuration = frameDuration,
				currentImg = currentImg,
				visible = visible)
예제 #11
0
파일: Door.py 프로젝트: aapope/OpenGLMaze
 def __init__(self, position, color,  door_id, rotation = 0, door_open = False, obj_type = "door"):
     '''Initialize door
     @type  position:  3-tuple (x, y, z)
     @param position:  Specifying the object's position
     @type  color:     3-tuple (R, G, B)
     @param color:     Specifying the color values
     @type  door_id:   Integer
     @param door_id:   The door's id
     @type  door_open: Boolean
     @param door_open: Specifies if the door is open (unlocked) or not
     @type  obj_type:  String
     @param obj_type:  This WorldObject's type
     '''
     #super(Key, self).__init__(self, position, color)
     WorldObject.__init__(self, position, color, obj_type)                #format from ibiblio website
     self.id = door_id
     self.rotation = rotation
     self.opened = door_open
     self.width = 1.3
     self.key = None
예제 #12
0
 def accelerateAndMove(self, restOfUniverse, time):
     WorldObject.accelerateAndMove(self, restOfUniverse, time)
     self.rotation += 360 / (self.rotationPeriod / time)
예제 #13
0
 def __init__(self, sublocale, effectType, duration):
     WorldObject.__init__(self, sublocale, effectType)
     self.duration = duration
예제 #14
0
 def calculateAccelerationVector(self, restOfUniverse):
     aX, aY, aZ = WorldObject.calculateAccelerationVector(self, restOfUniverse)
     tX, tY, tZ = self.vectorPointingForward(self.thrust)
     return aX + tX, aY + tY, aZ + tZ
예제 #15
0
	def nextStep (self):
		
		WorldObject.nextStep(self)

		self.physicMove()
예제 #16
0
파일: Sun.py 프로젝트: gpjt/explorer
 def __init__(self, location, velocity):
     WorldObject.__init__(self, 1.9891 * 10**30, location, velocity)
     self.radius = 1392000
     self.color = (1., 1., 0.5)
     self.lightNum = GL_LIGHT0
     self.name = "The Sun"
예제 #17
0
파일: Bot.py 프로젝트: dobrodeyJ/Survival
 def __init__(self, posX, posY, nameImage, width, height):
     WorldObject.__init__(self, posX, posY, nameImage, width, height)
예제 #18
0
 def __init__(self, location, velocity):
     WorldObject.__init__(self, 1000000000, location, velocity)
     self.name = "Space Station"
     self.rotationPeriod = 5 * 60
     self.rotation = 0
예제 #19
0
 def __init__(self, sublocale, effectType, duration):
     WorldObject.__init__(self, sublocale, effectType)
     self.duration = duration
예제 #20
0
 def __init__(self):
     '''
     Constructor
     '''
     WorldObject.__init__(CODE_VALID)
예제 #21
0
 def __init__(self, sublocale):
     WorldObject.__init__(self, sublocale, 'Structure')
     self.ID = ''
     self.produces = []
     self.consumes = []
예제 #22
0
 def __init__(self, posX, posY, nameImage, width, height):
     WorldObject.__init__(self, posX, posY, nameImage, width, height)
예제 #23
0
	def __init__(self, sublocale):
		WorldObject.__init__(self, sublocale, 'Structure')
		self.ID       = ''
		self.produces = []
		self.consumes = []