Ejemplo n.º 1
0
    def collision_start(self, other):
        """ This method will be called when an object starts colliding with another object """
        if other.tag() == 1:
            # Hit a bumper -- restore our last-known good position
            ssuge.log(self.name() + " just hit a bumper", (1, 1, 0.2), 3)
            self.set_world_position(*self.mLastPosition)

    #def collision_end(self, other):
    #	""" This method will be called when an object stops colliding with another object """
    #	ssuge.log(self.name() + " stopped hitting " + other.name(), (0.2, 0.2, 1.0), 3)
Ejemplo n.º 2
0
 def create(self, *args):
     ssuge.log("I'm an instance of 'AnotherClass'", (0.5, 0.5, 1), 10)
Ejemplo n.º 3
0
import ssuge
ssuge.log("Testing the ssuge c-python module log function.")
ssuge.createGroup("swaggers")
for i in range(5):
    boi = ssuge.GameObject("swaggers", "swag-boi" + str(i))
    boi.setScale(0.1, 0.1, 0.1)
    boi.setPosition((i - 2) * 9, 10, 0)
    boi.createMeshComponent("ogrehead.mesh")

camera = ssuge.GameObject("swaggers", "camera")
camera.setPosition(0, 10, 50)
camera.rotate(-10, 1, 0, 0)
camera.createCameraComponent(0)
Ejemplo n.º 4
0
	def create(self, *args):
		self.mMovingLeft = True
		self.mSpeed = 0.1
		self.mForwardTimer = None
		ssuge.log("made a fleet", (1, 1, 1), 1)
Ejemplo n.º 5
0
	def bump(self):
		if self.mForwardTimer == None:
			ssuge.log("BUMP!", (1, 1, 1), 3)
			self.mForwardTimer = 1.5
			self.mMovingLeft = not self.mMovingLeft
import ssuge
import random  # If this fails, check that you have the runtime python components in bin/Debug and bin/Release

ssuge.set_skybox("Examples/SpaceSkyBox")
ssuge.log("this will just go to the log file")
ssuge.log("a test visual / file log message", (1, 1, 0.2), 5.0)
rand_color = tuple(
    (random.uniform(0.5, 1.0) for i in range(3)))  # Nifty python generator!
ssuge.log("random color message", rand_color, 5.0)

# Each of these, if uncommented, should produce an error in the log
#print("Hello"						# A syntax error (missing paren)
#printx("Hello")					# A name error
#ssuge.log("a message", (2, 1, 0), 6)		# Value Error (from the 2 in the color)
#ssuge.log("a message", (1, 1, 1))			# Value Error (missing the time)
Ejemplo n.º 7
0
 def create(self, *args):
     ssuge.log("starting Ship.create...", (0, 1, 0), 5)
     self.mMoveRate = 5.0
     ssuge.register_input_listener(self)
     ssuge.log("...done with Ship.create", (0, 1, 0), 5)
Ejemplo n.º 8
0
 def axis_updated(self, axis, value):
     if abs(value) > 0.9:
         ssuge.log("axis '" + axis + "' is to the limit!")
Ejemplo n.º 9
0
 def action_released(self, name):
     if name == "fire":
         ssuge.log("un-PEW", (0.5, 0.1, 0.1), 2)
Ejemplo n.º 10
0
 def action_pressed(self, name):
     if name == "fire":
         ssuge.log("PEW", (1, 0, 0), 2)
Ejemplo n.º 11
0
 def update(self, dt):
     ssuge.log("updating.  dt=" + str(dt) + " rate=" + str(self.mRate),
               (1, 1, 1), 5)
     self.rotate_world(self.mRate * dt, 0, 0, 1)
Ejemplo n.º 12
0
def print(s):
    ssuge.log(str(s), (1, 0, 0), 10.0)
Ejemplo n.º 13
0
 def collision_start(self, other):
     ssuge.log(
         self.name() + " " + str(self.get_world_position()) + " hit " +
         other.name() + " " + str(other.get_world_position()),
         (0.2, 1, 0.2), 3)
     ssuge.queue_destroy(self)