Extended Possibilities with gameQuery?
  • Here are some ideas I ran across this week while sketching out my upcoming game and thought it would be appropriate to at least ask...

    • Any possibility of gameQuery communicating with JoyToKey.exe so users can plug in their USB joysticks into your laptops and play?
    • Any possibility for gameQuery to save and load games?
    • If player advances to level 2 within a game, which has a new scenery, can that be coded within the same playground or will the player advance to a new html page with a new playground?  What have gaming developers done in this situation?
    • What are some best practices for mixing up sprites with groups so that we have a very smooth and fluid performance? OR what is not recommended when creating sprites and groups together?  The only reason I ask is because I have sketched a layout which will entail 8 - 10 groups.  And each group having sprites.
    • Finally, any future possibility of gameQuery games being played offline on smartphones?


    Thanks!



  • selimselim
    Accepted Answer
    1. For the joystick interaction there is the poposed GamepadAPI (https://wiki.mozilla.org/GamepadAPI) but something like jotoKey should work out of the box as far as I know (haven't tried it though).
    2. To save and load game you could use cookies or the web storage (http://en.wikipedia.org/wiki/Web_storage)
    3. To change level you can now (since 0.7) use the following functions: pauseGame() then cleanAll() will pause the game and clean all sprites and animation. After that you can simply add new animations, sounds, sprites, tilemaps and groups just like you would at the begining of a normal game. Once you are done you can simply call resumeGame() and the game will behave just like when you called start game for the first time. The script that initializes the new level and resume the game can be in another js that you inject in the current page after having paused the game.
    4. The most important usage of groups is to separate the elements of you game that needs collision detections and the ones that don't. Then you can simply use the filter argument in collision() to check only the elements in the right group(s). Another usage is when you move around a bunch of sprites by exactly the same amount each time (like a player, is armor and weapon). Then instead of moving each of them separately you're better of having them all in a group and move the group around.
    5. You can already setup you game to play offline on smartphone. Just specify all the files you need to be cached in the manifest: http://dev.w3.org/html5/spec/offline.html . However some games may be really slow depending on you smartphone.


    Hope it answer you questions.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!