GithubHelp home page GithubHelp logo

gamequery's Introduction

gameQuery

About

gameQuery is a smallish plugin for jQuery that helps make javascript game development easier by adding some simple game-related classes and functions.

For more information please look at the project’s wiki

You can follow the project at http://www.twitter.com/gameQuery

Problem reports

For bug report or feature request please use the github tool.

Contributing

For more information about contributing to the project take a look at the github wiki https://github.com/onaluf/gameQuery/wiki

gamequery's People

Contributors

aaronwinborn avatar bugnano avatar fostuk avatar onaluf avatar tapostrophemo avatar vantreeseba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gamequery's Issues

tilemapEditor: background image not displaying in new animations

When adding a new animation in the tilemap editor, the background image does not display. This happens if the X- or Y-offset is not zero because the CSS is not properly formed. (Found issue in Firefox 13.0 on Ubuntu.)

I have a fix and will fork the project/create a pull request.

rotate not working in 0.6.0 anymore

The rotate() function does not work (for me) in Safari 5.1.4 and Firefox 10.0.2 (Mac) in gameQuery 0.6.0. It worked in 0.5.1.

gameQuery.factorh and gameQuery.factorv in line 1165 (and following) seems to be undefined, so that the input for the CSS transform is something like "rotate(90deg) scale(NaN, NaN).

Bug while setting dynamic TileMap out of the playground

Hi everybody!

Excuse me for my english cause it's not my native language.

So, it's a bit diffucult to explain me and I think a exemple will better show what I try to mean.

I host my game on my personal website to allows you to understand my problem.

You can see a teaser of my game here : http://polizzo.nicolas.perso.sfr.fr/web/bunnyup/

Actually, everything seems to work perfectly... BUT if we keep looking to animated flower and grass we will easily notice that the second generated tilemap (that one who is generated outside of screen at the beginning) is not moving.

I think it's may be a bug that why i'm notifying it to you.

Is there no solution or did I mess somewhere..?

Thanks in advance for your consideration.

Freezystem.

mouse functionality not working

I have mostly just been using the gameQuery functions and haven't tested any of the jQuery functions, but I'm trying to make it so the player can click on a sprite and have a div be appended to the group, but the click does nothing. I don't get any errors or warnings. This is my code:

...
.addGroup("NPCs", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT})
.addSprite("test_NPC1",{animation: NPC1_Animation["idle_left"],
posx: 0, posy: 0, width: 50, height: 100})
...
$("#test_NPC1").mousedown(function() {
alert('Handler for .mousedown() called.');
});

$.playground().registerCallback(function(){
...

I have tried mouseenter, mouseleave, and a few other mouse functions, but nothing.

scenegraph incorrectly positioned

The scenegraph is in the page flow and therefor can be displaced by other 'in flow' elements. It should instead be absolutely positioned at 0,0 in the playground's div.

some sprites are not cleared

I just checked out the master tutorial demo and saw one bullet sprite not being cleared and floating on the game sreen, I saw the same bug in the online demo. Is this a know bug? It seems to happen frequently.

Problem getting started

I'm not a total newb, but I'm new to Javascript libraries. I am trying to follow the beginning tutorial on the website, which says all I need is gameQuery, but it does nothing. I get an error saying "$ is not defined". I even tried downloading the zip file of a completed example and it shows up, but when I click start it does nothing. I can figure out what's wrong. I know my server supports Javascript... what server wouldn't? Any ideas?

tileset

I'm trying to use the tileset function in gameQuery, but there aren't any real examples. When I do it, I don't have any errors, but nothing is being drawn to the screen. The sprites are all drawn, but no tiles.

In my code I have:
...
var background0 = new $.gameQuery.Animation({imageURL: "./image.png"});

...
$.playground()
.addTilemap("myTilemap", new Array(0,1,2,3,3,2,1,3,0), new
Array(background0,background1,background2,background3),
{width: 32,
height: 32,
sizex: 3,
sizey: 3,
posx: 0}).end()
.addGroup("background", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}).end()
...

I wasn't really sure about the tileDescription, but I figured this would be fine.

Contribution to the gamequery

Hello selim

I would like to contribute some code to gamequery. Maybe it is not the time but I hope you find it useful for the tilemap editor tool.

Here is the code

var templ_dir = "BASE SITE DIRECTORY";
var templ_imgs = templ_dir+"SPRITE DIRECTORY";
var sprDelta = 32; //default sprite delta ( for use on tilemap, since all animations have the same delta )
var animations = [];

//this sets up a simple sprite into the animations array
function setupSprite(image,offsetx,offsety) {
animations.push(new $.gameQuery.Animation({
imageURL: templ_imgs+image,
type: $.gameQuery.ANIMATION_ONCE,
numberOfFrame: 1,
delta: sprDelta,
rate: 30,
offsetx: offsetx,
offsety: offsety
}));

}

//this allows to setup a building matrix on the animations array
function setupSpriteBuilding(image,startX,startY) {
//this needs some work, because this assumes that the building is composed by 9 tiles, on a 3 rows and 2 colums
//anyway the buildings can be organized in various layouts in the spritesheet.
for(i=0;i<2; i++) {
for(j=0; j<3; j++) {
setupSprite(image,startX+(sprDelta_j),startY+(sprDelta_i));
}
}
}

you call'em like this:

setupSprite('TileA5.png',0,32);
setupSprite('TileA5.png',0,64);

setupSpriteBuilding('edificios.png',192,64);

I'm working on how to make map placement easier, but i'll get there as soon as I can.

Best regards
jarodium

fadeTo not work ?

From the tutorial.js

// this try to respawn the ship after a death and return true if the game is over
this.respawn = function(){
this.replay--;
if(this.replay==0){
return true;
}

    this.grace  = true;
    this.shield = 3;

    this.respawnTime = (new Date()).getTime();
    $(this.node).fadeTo(0, 0.2);    // fadeTo does not work ?
    return false;
};

this.node is supposed to be $("#player") in this situation; why actually the func fadeTo seems not to work well here?

Player or Enemies without spriteAnimation, how to change imageURL

Hi,

First, sorry for my english language.

I have one "enemie" like that :

var enemie_1 = new $.gQ.Animation({imageURL: "img/angryhuman_face.png"});
$('#tilemap').addSprite("enemie_1",{animation: enemie_1, height:48, width:48, posx:480, posy:96});

I wanted to ask you if it is possible to change that
' imageURL: "img/angryhuman_face.png" ', in the registerCallback function.

My "enemie" haven't animation, just 4 states : face, back, left, right.

Thanks to clarify me on this point.

Have a nice day

Issue with recognision of gamequerry functions

Hello!

I have followed with interest the tutorial at http://gamequeryjs.com/ Still I have dificulties to run my game altough I have thouroughly followed the instructions because functions like playground are not recognised.
Is this a general problem? Can you help me with some suggestions?

Thanks!

Callback get executed more than once for ONCE animations

If an animation is defined as $.gQ.ANIMATION_CALLBACK | $.gQ.ANIMATION_ONCE and a callback is added it will be executed once the last frame is displayed and every refereshRate milisec. form there until the animation is changed!

why is "undefined"???

hi
im develop game in gamequery
but it always appear
"game.php:728TypeError: 'undefined' is not an object (evaluating '$.playground().addGroup')"
and it appear a blank page
i dont know what happened
please help me T^T

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.