Standards - Hivetek/Planetoid GitHub Wiki

Stick to using these standards!

Units

For physics, SI-units are preferred, with a conversion-factor to pixels. Realworld physics should be used whenever possible.

  • 1m = 50px
  • Acceleration: m/second^2
  • Speed: m/second
  • Dimensions: meter
  • Time: seconds
  • Angles: radians.
  • Mass: gravitational acceleration in m/s^2.

More standards to come!

Performance tips

  • Don't use save() and restore(), rather just put the changed settings back to what they were before.
  • Use integers for sprite coordinates wherever possible
  • Pre-render/cache to in-memory canvases for minimizing redraws.
  • Use prototypes for objects!