Skip to content

JavaScript Framework

jeremyckahn edited this page Aug 21, 2012 · 4 revisions

This page contains an overview of the Pine JavaScript framework.

Since Pine will have a JavaScript-based client and server, it needs a framework that addresses its unique needs. The framework that powers the local server and the client will share the same source, but there can be custom binaries for each if we need them. The code for this framework lives here. The functionality this framework needs to provide:

  • Input
  • Graphics
  • Memory management
  • Client-server socket communication
  • Server asset management
  • Client asset management

Input

Since games are safely sandboxed in iframes, all input is proxied via the Pine app.

Graphics

Raspberry Pi has a slow CPU but a decent GPU, so the framework needs to take advantage of Chromium's hardware acceleration capabilities. This includes CSS 3 animations and WebGL.

Memory management

Research needs to be done on how to provide an efficient, reusable memory management API.

Client-server socket communication

A wrapper or fork of Socket.IO might be all that's necessary here.

Server asset management

We need to develop a standardized convention for organizing assets that will work with this. This can be very lightweight.

Client asset management

Spriting may not be necessary since everything is local, but there should be an API for easily loading images. Also, we need audio playback APIs. A script loader probably won't be necessary. Most of what this API needs to do has already been done, so we should work to wrap existing libraries in a convenient way.