在pygame中添加计时器

时间:2017-12-01 19:21:09

标签: python pygame

  

有人会知道如何编写一个计时器,以便在pygame中显示在屏幕上,那时用户正在玩的时间会增加吗?

1 个答案:

答案 0 :(得分:0)

此链接可能会有所帮助

http://www.pygame.org/docs/ref/time.html#pygame.time.get_ticks

你可以做这样的事情

import React, {
  Component
} from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {
  render() {
    return ( <
      div className = "App" >
      <
      header className = "App-header" >
      <
      img src = {
        logo
      }
      className = "App-logo"
      alt = "logo" / >
      <
      h1 className = "App-title" > Welcome to React < /h1> <
      /header> <
      p className = "App-intro" >
      To get started, edit < code > src / App.js < /code> and save to reload. <
      /p> <
      /div>
    );
  }
}

export default App;