GithubHelp home page GithubHelp logo

supertypist's People

Contributors

baoyukun avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

supertypist's Issues

the error of [pip install -r requirements.txt]

ERROR: Could not find a version that satisfies the requirement time (from versions: none)
ERROR: No matching distribution found for time

why ?
i had seen the file of requirements.txt
in the file there
pygame
argparse
time
re
what are time and re ?
can you help me ?

Reuse Font objects multiple times

You mentioned in pygame/pygame#673 that the game is using a lot of CPU rendering the text. I suspect (but have not profiled the game) that you can gain a considerable performance by avoiding the reloading of the Fonts for each word rendered.

I.e.

            word_surface = pygame.font.Font(
                None, 36).render(wordText, 1, color)

Would be replaced with:

# in __init__
[...]
            self.font = pygame.font.Font(None, 36)

# in renderWord
            word_surface = self.font.render(wordText, 1, color)

Another approach that might work in this particular game would be to cache the rendered words (clearing the cache when self.text is reset).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.