Giter Site home page Giter Site logo

everydaycodingtrain's Introduction

everydaycodingtrain's People

Contributors

duskvirkus avatar esser50k avatar shiffman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

everydaycodingtrain's Issues

Game of Life's slow frame rate is maybe due to scanForTouch()

scanForTouch() apparently takes 100 milliseconds, according to the source code:

// This whole procedure should take about 100 milliseconds
bool EverydayCalendar_touch::scanForTouch(){

If that's accurate, the best frame rate you could possibly hope for would be 10FPS even if the rest of the code took no time.

Suggested solutions:

ideal:

Find a fast way to check for touch - interrupt-based?

naive:

instead of scanForTouch every frame, do it only one in 5 or one in 10 "frames". However, that will give us an unpleasant irregular frame duration. (e.g. 4 fast frames, 1 slow, etc)

better:

Model two modes: a "pattern programming" mode and a "run simulation" mode. In pattern programming mode, you'd scanForTouch every frame to be nice and responsive to touch - we don't care about the slow frame rate when programming patterns.
In "run simulation" mode, however, only scan for touch rarely (e.g. once every 5 seconds?) - the user will have to hold a button down for a while to get out of simulation mode and back into pattern programming mode.
This would still give us one slower frame every 5 seconds but hopefully that's not too noticeable.
Maybe check only one key to get out of "run simulation" mode, if it's significantly faster to check one key for touch than all.

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.