コード例 #1
0
ファイル: game.py プロジェクト: Nelluq/PyCap-Tileset-Library
def update( delta ):
	global scrollX
	global scrollY
	
	PC.markDirty()
	
	scrollX += (rightDown - leftDown) * 2
	scrollY += (downDown - upDown) * 2
	
	map.update(delta, scrollX, scrollY)
コード例 #2
0
ファイル: game.py プロジェクト: seem-sky/tuxcap
def draw():
    # clear the screen
    PC.setColour(255, 255, 255, 255)
    PC.fillRect(0, 0, 800, 600)

    # draw the player
    player.draw()

    # draw the things
    for t in things:
        t.draw()
コード例 #3
0
ファイル: game.py プロジェクト: seem-sky/tuxcap
def update(delta):

    # Tell the engine that we need to call the draw function
    PC.markDirty()

    # update the player
    player.update(delta)

    # update the things
    for t in things:
        t.update(delta)
コード例 #4
0
ファイル: game.py プロジェクト: keestux/tuxcap
def draw():
    # clear the screen
    PC.setColour( 255, 255, 255, 255 )
    PC.fillRect( 0, 0, 800, 600 )
    
    # draw the player
    player.draw()
    
    # draw the things
    for t in things:
        t.draw()
コード例 #5
0
ファイル: game.py プロジェクト: keestux/tuxcap
def update( delta ):
    
    # Tell the engine that we need to call the draw function
    PC.markDirty()

    # update the player
    player.update( delta )
    
    # update the things
    for t in things:
        t.update( delta )
コード例 #6
0
ファイル: tile.py プロジェクト: Nelluq/PyCap-Tileset-Library
 def draw(self):
     if self.definition.has_key("image"):
         print "image tiles not yet supported"
     elif self.definition.has_key("color"):
         PC.setColour(
             TileColors[self.definition["color"]]["red"],
             TileColors[self.definition["color"]]["green"],
             TileColors[self.definition["color"]]["blue"],
             255,
         )
         PC.fillRect(self.x, self.y, self.s, self.s)
     else:
         print "tile must have color or image attribute"
コード例 #7
0
ファイル: game.py プロジェクト: MEGAFRED/RunShootRun
def draw():
	# set the game font
	PC.setFont(gameFont)
	
	# make a white screen to initialize the framebuffer
	PC.setColour(255, 255, 255, 255)
	PC.fillRect(0, 0, screenWidth, screenHeight);

	# draw the player
	player.draw()
	
	# display the player's angle for debugging purposes
	PC.setColour(0, 0, 0, 255)
	PC.drawString(str(player.angle), 5, 25)
コード例 #8
0
ファイル: game.py プロジェクト: seem-sky/tuxcap
 def draw(self):
     # to make this a little more interesting we'll tint it and spin it around
     PC.setColourize(1)  # enable tinting
     PC.setColour(255, 45, 45, 127)  # tint red and semi transparent
     PC.drawImageRotF(self.image, self.x - self.width * 0.5,
                      self.y - self.height * 0.5,
                      self.a)  # draw rotated image
     PC.setColourize(0)  # disable tinting
コード例 #9
0
ファイル: game.py プロジェクト: keestux/tuxcap
def update( delta ):
    PC.markDirty()
コード例 #10
0
ファイル: game.py プロジェクト: seem-sky/tuxcap
 def draw(self):
     # call the draw function. This version takes floating point arguments so the object moves smoothly, rather than jumping one pixel at a time
     # we offset by the width and the height so that the image is drawn with self.x and self.y at its middle.
     PC.drawImageF(self.image, self.x - self.width * 0.5,
                   self.y - self.height * 0.5)
コード例 #11
0
def update(delta):
    PC.markDirty()
コード例 #12
0
ファイル: game.py プロジェクト: MEGAFRED/RunShootRun
def update( delta ):
	PC.markDirty()

	player.update(delta)
コード例 #13
0
ファイル: game.py プロジェクト: MEGAFRED/RunShootRun
        def draw(self):
			PC.drawImageRotF(self.image, self.x - self.width * 0.5, self.y - self.height * 0.5,self.angle - math.pi / 2)
コード例 #14
0
ファイル: game.py プロジェクト: keestux/tuxcap
 def draw( self ):
     # to make this a little more interesting we'll tint it and spin it around
     PC.setColourize( 1 )    # enable tinting
     PC.setColour( 255, 45, 45, 127 ) # tint red and semi transparent
     PC.drawImageRotF( self.image, self.x - self.width * 0.5, self.y - self.height * 0.5, self.a )   # draw rotated image
     PC.setColourize( 0 )    # disable tinting
コード例 #15
0
ファイル: game.py プロジェクト: keestux/tuxcap
 def draw( self ):
     # call the draw function. This version takes floating point arguments so the object moves smoothly, rather than jumping one pixel at a time
     # we offset by the width and the height so that the image is drawn with self.x and self.y at its middle.
     PC.drawImageF( self.image, self.x - self.width * 0.5, self.y - self.height * 0.5 )
コード例 #16
0
ファイル: game.py プロジェクト: Nelluq/PyCap-Tileset-Library
def draw():
	PC.setColour(255, 255, 255, 255)
	PC.fillRect(0, 0, 800, 600)
	map.draw()