• <tfoot id='iUj2v'></tfoot>

    <legend id='iUj2v'><style id='iUj2v'><dir id='iUj2v'><q id='iUj2v'></q></dir></style></legend>

        <bdo id='iUj2v'></bdo><ul id='iUj2v'></ul>

    1. <i id='iUj2v'><tr id='iUj2v'><dt id='iUj2v'><q id='iUj2v'><span id='iUj2v'><b id='iUj2v'><form id='iUj2v'><ins id='iUj2v'></ins><ul id='iUj2v'></ul><sub id='iUj2v'></sub></form><legend id='iUj2v'></legend><bdo id='iUj2v'><pre id='iUj2v'><center id='iUj2v'></center></pre></bdo></b><th id='iUj2v'></th></span></q></dt></tr></i><div id='iUj2v'><tfoot id='iUj2v'></tfoot><dl id='iUj2v'><fieldset id='iUj2v'></fieldset></dl></div>
    2. <small id='iUj2v'></small><noframes id='iUj2v'>


        How can I make a sprite move when key is held down(按住键时如何进行精灵移动)

        <small id='bPnRB'></small><noframes id='bPnRB'>

          <tbody id='bPnRB'></tbody>

          <tfoot id='bPnRB'></tfoot>
            <i id='bPnRB'><tr id='bPnRB'><dt id='bPnRB'><q id='bPnRB'><span id='bPnRB'><b id='bPnRB'><form id='bPnRB'><ins id='bPnRB'></ins><ul id='bPnRB'></ul><sub id='bPnRB'></sub></form><legend id='bPnRB'></legend><bdo id='bPnRB'><pre id='bPnRB'><center id='bPnRB'></center></pre></bdo></b><th id='bPnRB'></th></span></q></dt></tr></i><div id='bPnRB'><tfoot id='bPnRB'></tfoot><dl id='bPnRB'><fieldset id='bPnRB'></fieldset></dl></div>
              <bdo id='bPnRB'></bdo><ul id='bPnRB'></ul>

                1. <legend id='bPnRB'><style id='bPnRB'><dir id='bPnRB'><q id='bPnRB'></q></dir></style></legend>
                2. 本文介绍了按住键时如何进行精灵移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!


                  目前,每次按下一个键,精灵只会移动 1 个像素.按住左键或右键时,如何使水管工精灵不断移动?

                  Currently the sprite only moves 1 pixel every time a key is pressed. How could I cause the plumber sprite to move constantly when left or right key is being held down?

                  while running:
                      spriteimg = plumberright
                      screen.blit(spriteimg,(x1, y1))
                      for event in pygame.event.get():
                           if event.type == pygame.QUIT:
                               running = False
                           elif event.type == pygame.KEYDOWN:
                               if event.key == pygame.K_UP:
                                   x1 = x1 + 0
                                   y1 = y1 - 1
                               elif event.key == pygame.K_DOWN:
                                   x1 = x1 + 0
                                   y1 = y1 + 1
                               elif event.key == pygame.K_LEFT:
                                   x1 = x1 -1
                                   y1 = y1 + 0
                               elif event.key == pygame.K_RIGHT:
                                   x1 = x1 + 1
                                   y1 = y1 + 0


                  你可以使用 pygame.key.get_pressed 这样做.

                  You can use pygame.key.get_pressed to do that.


                  while running:
                      keys = pygame.key.get_pressed()  #checking pressed keys
                      if keys[pygame.K_UP]:
                          y1 -= 1
                      if keys[pygame.K_DOWN]:
                          y1 += 1




                  Split a Pandas column of lists into multiple columns(将 Pandas 的列表列拆分为多列)
                  How does the @property decorator work in Python?(@property 装饰器在 Python 中是如何工作的?)
                  What is the difference between old style and new style classes in Python?(Python中的旧样式类和新样式类有什么区别?)
                  How to break out of multiple loops?(如何打破多个循环?)
                  How to put the legend out of the plot(如何将传说从情节中剔除)
                  Why is the output of my function printing out quot;Nonequot;?(为什么我的函数输出打印出“无?)
                    <i id='1rhde'><tr id='1rhde'><dt id='1rhde'><q id='1rhde'><span id='1rhde'><b id='1rhde'><form id='1rhde'><ins id='1rhde'></ins><ul id='1rhde'></ul><sub id='1rhde'></sub></form><legend id='1rhde'></legend><bdo id='1rhde'><pre id='1rhde'><center id='1rhde'></center></pre></bdo></b><th id='1rhde'></th></span></q></dt></tr></i><div id='1rhde'><tfoot id='1rhde'></tfoot><dl id='1rhde'><fieldset id='1rhde'></fieldset></dl></div>

                      <tbody id='1rhde'></tbody>

                      • <bdo id='1rhde'></bdo><ul id='1rhde'></ul>
                        <tfoot id='1rhde'></tfoot><legend id='1rhde'><style id='1rhde'><dir id='1rhde'><q id='1rhde'></q></dir></style></legend>

                            <small id='1rhde'></small><noframes id='1rhde'>