当前位置: 首页>>代码示例>>Python>>正文


Python Player.x方法代码示例

本文整理汇总了Python中Player.x方法的典型用法代码示例。如果您正苦于以下问题:Python Player.x方法的具体用法?Python Player.x怎么用?Python Player.x使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.x方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: dMap

# 需要导入模块: import Player [as 别名]
# 或者: from Player import x [as 别名]
from Enemy import *
from Item import *
from functions import *



showInventory=False
npcs=[]
Inventory=[]
items=[]
gameState=0
Rmap= dMap()
Rmap.makeMap(startx,starty,110,50,60)
pos=PlacePlayer(Rmap)
guy=Player()
guy.x=pos[0]
guy.y=pos[1]
npcs=generateList(Rmap,npcs,Enemy,.09)
Rmap=PlaceList(Rmap,npcs,9)
attack=False
items=generateList(Rmap,items,Item,.07)
Rmap=PlaceList(Rmap,items,6)

def restart2():
    global showInventory,npcs,Rmap,gameState,guy
    print "hello"
    showInventory=False
    npcs=[]
    Inventory=[]
    items=[]
    gameState=0
开发者ID:Stever1975,项目名称:Scriptorium,代码行数:33,代码来源:pyDungeon.py

示例2: not

# 需要导入模块: import Player [as 别名]
# 或者: from Player import x [as 别名]
                snb.wallJump_Left = False
                snb.wallJump_Right = False
            elif not(w.rect.colliderect(snb.bottom)) and w.floor_active == True:
                w.floor_active = False

            if w.rect.colliderect(snb.top):
                snb.dy = 0
                snb.apex = True

            if w.rect.colliderect(snb.left) and (w.wall_active == False or w.wall_active == True):

                if pressed['Space'] == False:
                    snb.canJump = True

                snb.contact_side = "Left"
                snb.x = (w.x + w.image_w - 1)
                snb.onwall = True
                w.wall_active = True
                snb.wallJump_Left = False
                snb.wallJump_Right = False

            elif w.rect.colliderect(snb.right) and (w.wall_active == False or w.wall_active == True):
                
                if pressed['Space'] == False:
                    snb.canJump = True
                
                snb.contact_side = "Right"
                snb.x = (w.x - snb.image_w + 1)
                snb.onwall = True
                w.wall_active = True
                snb.wallJump_Left = False
开发者ID:nchen24,项目名称:superninjaboy,代码行数:33,代码来源:game.py

示例3: Player

# 需要导入模块: import Player [as 别名]
# 或者: from Player import x [as 别名]
weapons[K_6] = Frag
weapons[K_7] = PowerBullet
weapons[K_p] = PlayerSpawn
ammo = {}
ammo[Bullet] = 1000
ammo[SplitBullet] = 10000
ammo[AngleBullet] = 1000
ammo[PowerBullet] = 1000
ammo[CarpetBomb] = 100
ammo[PineappleBomb] = 500
ammo[PlayerSpawn] = 100
ammo[Frag] = 1000
ammo[None] = 0

p1 = Player(universe)
p1.x = 90
p1.y = 200
p1.color = [255, 0, 0]
player = p1

p2 = Player(universe)
p2.x = 510
p2.y = 400
p1.color = [128, 64, 192]

dt = 0

power = 121
keys = set()
curWep = None
TopLeft = (0, 0)
开发者ID:theepicsnail,项目名称:TestingArea,代码行数:33,代码来源:Main.py

示例4: game_init

# 需要导入模块: import Player [as 别名]
# 或者: from Player import x [as 别名]
    message_color = color


#define ASCII codes used for dungeon
TILE_EMPTY = 177
TILE_ROOM = 31
TILE_HALL = 31

#main program begins
game_init()
game_over = False
last_time = 0
dungeon = Dungeon(30, 30)
dungeon.generate(TILE_EMPTY,TILE_ROOM,TILE_HALL)
player = Player(dungeon, 1, "Player")
player.x = dungeon.entrance_x+1
player.y = dungeon.entrance_y+1
level = 1
message_text = "Welcome, brave adventurer!"
message_color = 0,200,50
draw_radius = False

#used to estimate attack damage
att = list(0 for n in range(0,5))
attlow=90
atthigh=0

#main loop
while True:
    timer.tick(30)
    ticks = pygame.time.get_ticks()
开发者ID:RonnieLMayberry,项目名称:PAP-CS,代码行数:33,代码来源:Game.py


注:本文中的Player.x方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。