Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I would like run my game withoud internet #10

Closed
alessiodallapiazza opened this issue Jan 20, 2013 · 1 comment
Closed

I would like run my game withoud internet #10

alessiodallapiazza opened this issue Jan 20, 2013 · 1 comment

Comments

@alessiodallapiazza
Copy link

I don't like json load model for sprite or level.
It possible use array or other ?

With json you can run game only in server really ?

Thank you.

@cykod
Copy link
Owner

cykod commented Jan 20, 2013

Hi @clshack,

All that asset loading does is put entries in the Q.assets[assetName] hash, so it's not a problem if you want to work around this (I'm working on some minification code that does this automatically), the easiest way is just to add some stuff directly onto that assets hash:

Q.assets['sprites.json'] = { ... json data ... }
Q.assets['level1.json'] = [ [ 0, 0, 0, ... ], [ ... ] ... ]

The way I've done it in production games is to create a separate Quintus module that has your data in it:

 // in mygame_mydata.js 
Quintus.MyData = function(Q) {
  Q.assets['sprites.json'] = { ... json data ... }
  ... set more assets ...
}

// in mygame.js, make sure your HTML loads mygame_mydata.js
var Q = Quintus().include("Sprites, Scenes, ..., MyData");

// You'll now have your assets preloaded and can use offline without a server

This is something worth noting in the guide - I'll add it in.

@cykod cykod closed this as completed Jan 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants