notpygamejs

Source

Classification

Summary

notpygamejs Game making library for Javascript with the Canvas element. Andrej Karpathy 1 May 2012 Usage This library abstracts away boring stuff such as game loop, mouse, keyboard API calls, etc etc etc. All that is left to do is to implement the meat of the following functions: The library assumes that your HTML file looks, for example as: In other words, call NPGinit({ FPS}) function once somewhere in your code. The function will hook its functionality into a canvas on the page with id “NPGcanvas”. Since this is not using any namespaces, a few things get added to global namespace (I know, I know…). For now,…

What This Teaches

  • How a complex idea can be compressed into a minimal but working implementation.
  • Useful as a reference style for serious small systems rather than decorative demos.

Why It Matters

This matters as part of Karpathy’s broader pattern: compress hard technical systems into readable, inspectable, working artifacts.

Repository Snapshot

  • Full name: karpathy/notpygamejs
  • Default branch: master
  • HEAD: 6ee48fa769b88bf618fc44070fd5cb7a5f9eb832
  • Stars at crawl: 101
  • Forks at crawl: 21
  • File count: 8
  • README path: Readme.md
  • License path: “
  • Created: 2012-01-02T04:55:06Z
  • Updated: 2026-05-07T21:21:47Z
  • Pushed: 2023-10-17T14:11:25Z

Top-Level Structure

  • demos: 4
  • [root]: 2
  • include: 2

File Extension Profile

  • .html: 5
  • .js: 2
  • .md: 1

Tags / Release-Like Markers

  • No git tags found in the shallow local clone.

Sample File Tree

  • demos/ballbounce.html
  • demos/evolve.html
  • demos/exgame.html
  • demos/particles.html
  • include/npgmain.js
  • include/vector2D.js
  • Readme.md
  • starter.html

Public Handling Notes

  • EXTRACTED: This page records public metadata and a source-grounded summary.
  • INFERRED: Full local preservation, when available, is for private/local use unless a license or explicit source policy makes public redistribution safe.
  • Do not treat this page as permission to republish unlicensed source text or code wholesale.