onaluf / gamequery Goto Github PK
View Code? Open in Web Editor NEWa javascript game engine with jQuery
Home Page: http://gamequeryjs.com
a javascript game engine with jQuery
Home Page: http://gamequeryjs.com
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.
If an animation is defined as
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.
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
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!
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?
setAnimation does not change the background-image anymore. (But works fine on the stable Version 0.5.1.
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.
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?
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
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).
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.
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.
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.
jquery.gamequery.ext.js should probably be namespaced for library compatibility:
(function($) {
// ...
})(jQuery);
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.