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


Python pygame.K_t方法代码示例

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


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

示例1: keyup

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_t [as 别名]
def keyup(self, key):
        """ Update velocities based on key released
        Arguments:
            key: pygame key
        """
        if key == pygame.K_UP or key == pygame.K_DOWN:  # set zero forward/backward velocity
            self.for_back_velocity = 0
        elif key == pygame.K_LEFT or key == pygame.K_RIGHT:  # set zero left/right velocity
            self.left_right_velocity = 0
        elif key == pygame.K_w or key == pygame.K_s:  # set zero up/down velocity
            self.up_down_velocity = 0
        elif key == pygame.K_a or key == pygame.K_d:  # set zero yaw velocity
            self.yaw_velocity = 0
        elif key == pygame.K_t:  # takeoff
            self.tello.takeoff()
            self.send_rc_control = True
        elif key == pygame.K_l:  # land
            not self.tello.land()
            self.send_rc_control = False 
开发者ID:damiafuentes,项目名称:DJITelloPy,代码行数:21,代码来源:manual-control-pygame.py

示例2: KeyDown

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_t [as 别名]
def KeyDown(self,event):
        """
        if event.key == pygame.K_PAGEUP:
            self.EasingAllPageLeft()
            #self.SwapAndShow()
        if event.key == pygame.K_PAGEDOWN:
            self.EasingAllPageRight()
            #self.SwapAndShow()
        """
        
        if event.key == pygame.K_t:
            self.DrawRun()
            self.SwapAndShow()
        
        """
        if event.key == CurKeys["Space"]:
            self._CounterScreen.Draw()
            self._CounterScreen.SwapAndShow()
            self._CounterScreen.StartCounter()
        """ 
        ## leave rest to Pages
        current_page_key_down_cb = getattr(self._CurrentPage,"KeyDown",None)
        if current_page_key_down_cb != None:
            if callable( current_page_key_down_cb ):
                self._CurrentPage.KeyDown(event)
                
        self._LastKey = event.key 
开发者ID:clockworkpi,项目名称:launcher,代码行数:29,代码来源:main_screen.py

示例3: __init__

# 需要导入模块: import pygame [as 别名]
# 或者: from pygame import K_t [as 别名]
def __init__(self, input, target):
        
        super().__init__()
    
        self.input = input
        self.target = target
        
        # forward vector stays level with horizontal plane
        self.forward = np.array( [0, 0, -1] )
        # up vector is constant
        self.up = np.array( [0,1,0] )
        # recalculate right vector whenever forward vector changes
        self.right = np.cross( self.forward, self.up )
        
        # control rate of movement
        self.deltaTime = 1.0/60.0 # TODO: get actual number from input? 
        self.unitsPerSecond = 1
        self.moveAmount = self.unitsPerSecond * self.deltaTime
        self.degreesPerSecond = 60
        self.turnAmount = self.degreesPerSecond * (3.1415926 / 180) * self.deltaTime

        # customizable key mappings
        # standard controls (WASDRF, QETG)     

        self.KEY_MOVE_FORWARDS  = pygame.K_w
        self.KEY_MOVE_BACKWARDS = pygame.K_s
        self.KEY_MOVE_LEFT      = pygame.K_a
        self.KEY_MOVE_RIGHT     = pygame.K_d
        self.KEY_MOVE_UP        = pygame.K_r
        self.KEY_MOVE_DOWN      = pygame.K_f
        self.KEY_TURN_LEFT      = pygame.K_q
        self.KEY_TURN_RIGHT     = pygame.K_e
        self.KEY_LOOK_UP        = pygame.K_t
        self.KEY_LOOK_DOWN      = pygame.K_g 
开发者ID:stemkoski,项目名称:three.py,代码行数:36,代码来源:FirstPersonController.py


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