A Basic Javascript Game engine