Support - gameQuery's community http://forum.gamequeryjs.com/categories/help-me%21/feed.rss Mon, 16 Mar 2024 19:12:39 +0000 Support - gameQuery's community en-CA How can I prevent the game from restarting to allow for high score posting? http://forum.gamequeryjs.com/discussion/262/how-can-i-prevent-the-game-from-restarting-to-allow-for-high-score-posting Tue, 21 Oct 2023 07:28:30 +0000 DougS 262@/discussions
1. The "post" code runs before users can input their name
2. The game resets when a user clicks the "post" button even though they haven't clicked "restart game" It seems as though the game restart is triggered on ANY click even when I comment out the "$("#restartbutton").click(restartgame);" line

I would like to have two click event options as follows:

$("#postscorebutton").click(PostHighScore(encodeURIComponent(document.getElementById("highscoreuser").value), newscore));
$("#restartbutton").click(restartgame);

]]>
getting started with gameQuery http://forum.gamequeryjs.com/discussion/261/getting-started-with-gamequery Fri, 15 Aug 2023 19:24:25 +0000 pedrojovelli 261@/discussions
I got really interested to use the gameQuery.
I'm a webdesigner. I don't have much knowledge about programming, but I've been working with AS3 at the Flash times... I would like to understand a bit more about GAMEQUERY.

Is there a place that I can get tutorials and examples to download ?

if not, I really would like to help doing that!

Best]]>
Problem Collision player Jump http://forum.gamequeryjs.com/discussion/260/problem-collision-player-jump Thu, 31 Jul 2023 19:12:27 +0000 webugcl 260@/discussions
I have problem, player collision not detect my code is:

[code]
$.playground()
.addGroup("bg",{posx: 0, posy: 0, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT})
.addTilemap('tilemap', map, animations, {width: 25, height: 25, sizex: 20, sizey: 18}).end()
.addGroup("player", {posx: 400, posy: 335, width: MONKEY_WIDTH, height: MONKEY_HEIGHT})
.addSprite('monkeyup', { posx: 72, posy: 0, width: MONKEY_WIDTH, height: MONKEY_HEIGHT})
.addSprite('monkey', {animation: playerAnimation["normal"], posx: 0, posy: 0, width: MONKEY_WIDTH, height: MONKEY_HEIGHT})

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



if(jQuery.gameQuery.keyTracker[87] && ACTIVE_JUMP == 0){ //this is left! (a)
ACTIVE_JUMP = 1;
}

if(ACTIVE_JUMP==1 && ((inicialY-altosalto) < $("#player").y()) ){
saltoY = $("#player").y()-5*gravedad;
$("#player").y(saltoY);
} else if(ACTIVE_JUMP==1 || ACTIVE_JUMP==2){
ACTIVE_JUMP=2;
saltoY = $("#player").y()+5*gravedad;
$("#player").y(saltoY);
}

$("#player").collision("#tilemap .gQ_tile").each(function(){
console.log(1);
// do something with the id
});



}, REFRESH_RATE);


[/code]]]>
Problem with step 1, tutorial 1: Code cannot run http://forum.gamequeryjs.com/discussion/259/problem-with-step-1-tutorial-1-code-cannot-run Sun, 06 Jul 2023 19:00:01 +0000 armylovehere 259@/discussions
I'm trying to follow the instructionn in step 1: http://gamequeryjs.com/documentation/first-tutorial/first-tutorial-step-1/
(I'm copying the code to be exact. I want to make it run first and then go through the code and try to understand what it's doing).

Here's my html file: http://paste.ubuntu.com/7727632/
My engine.js file: http://paste.ubuntu.com/7727627/

However, when I click on "Click here to show the demo", nothing happen. Also, when I go to http://gamequeryjs.com/demos/3/background1.png, it just shows a blank white page??? Can anyone help me?]]>
Book jQuery Game Development Essentials http://forum.gamequeryjs.com/discussion/187/book-jquery-game-development-essentials Sat, 03 Aug 2023 05:08:08 +0000 AlexPorfirio 187@/discussions Delta calculation http://forum.gamequeryjs.com/discussion/250/delta-calculation Mon, 16 Dec 2023 14:19:49 +0000 brim 250@/discussions
I don't know enough about delta calculation to know what this is from the explanation in the documentation.
http://gamequeryjs.com/documentation/api/#Animation

delta: the width of height (depending on the type) of one frame

The width of height sounds like a typo to me, maybe I'm just that clueless :-)]]>
Mouse collision with tile http://forum.gamequeryjs.com/discussion/249/mouse-collision-with-tile Thu, 12 Dec 2023 12:41:40 +0000 alexcroox 249@/discussions
I can't seem to work out how to detect a collision between the mouse and tiles using the engine. I've tried:

$.gQ.mouseTracker.collision('.gQ_tileType_0').each(function() {

but that just throws an error.

At the moment I've fallen back to doing this:

$('.gQ_tileType_0').live("mouseenter",function() {

but I'd love to know how to do it properly.]]>
looping sound bug http://forum.gamequeryjs.com/discussion/248/looping-sound-bug Mon, 02 Dec 2023 01:20:20 +0000 mmelon 248@/discussions
Using gameQuery rev. 0.7.0 and SoundManager 2 V2.97a.20121104.

I am instantiating a sound and asking it to loop

player.engineSound = new $.gQ.SoundWrapper("sounds/engine.mp3", true);

then

$('#player').addSound(player.engineSound).playSound();

does cause the sound to play and loop/repeat ONCE before stopping.

I can log out the loop logic in soundwrapper.soundmanager2.js

// plays the sound if this.ready == true
this.play = function(){
if(loop){
this.sound.play({
onfinish: function() {
this.play();
alert('attempting a loop');
}
});
} else {
this.sound.play();

}
};

and as I have said, it will alert the message once, repeat, then never trigger the onfinish method again.

Is this a known bug or am I doing something wrong?

Kind regards,
Mike]]>
Detecting collision() while using jQuery's Animate() method http://forum.gamequeryjs.com/discussion/247/detecting-collision-while-using-jquery-s-animate-method Sun, 24 Nov 2023 06:54:08 +0000 blackhawx 247@/discussions
I'm currently using the following code to move a sprite item across the screen....

$("#player").animate({'left':50px},800,'easingplugin');

How can I make gameQuery's collision detection work for my #player item, using animate()?

At the moment, it doesn't work when my player collides with other sprites in the playground.

Thanks for any advice!


]]>
scratch and see through effect http://forum.gamequeryjs.com/discussion/246/scratch-and-see-through-effect Thu, 14 Nov 2023 07:50:52 +0000 blackhawx 246@/discussions I'm coming out with a holiday card animation card that involves an elf scratching off a board and revealing a coupon while he scratches it. Do you have any examples of something to that effect?

Thanks!
]]>
Looking for any examples of a fluid playground width for responsive gaming http://forum.gamequeryjs.com/discussion/245/looking-for-any-examples-of-a-fluid-playground-width-for-responsive-gaming Tue, 22 Oct 2023 05:22:59 +0000 blackhawx 245@/discussions
Thanks
]]>
Collision Placement and Performance... http://forum.gamequeryjs.com/discussion/244/collision-placement-and-performance Fri, 20 Sep 2023 17:12:47 +0000 sdvermillion 244@/discussions
The filter is correct as collision is detected at at least one place but when I change it's location in the code, performance suffers. What am I missing here?
$.playground().registerCallback( function() {
if( $( '#player' ).collision( '.' + $.gameQuery.tilemapCssClass + ', .solid' ).length > 0 ) {
console.log("collided here");
}
if( jQuery.gameQuery.keyTracker[65] ) {
var nextpos = $( "#player" ).x() - 5;
if( nextpos > 0 ){
$( '#player' ).x( nextpos );
if( $( '#player' ).collision( '.' + $.gameQuery.tilemapCssClass + ', .solid' ).length > 0 ) {
console.log( "collided there" ).length);
$( '#player' ).x( nextpos + 5 );
}
}
}
//...
}, 50);
]]>
getAnimation? http://forum.gamequeryjs.com/discussion/243/getanimation Tue, 17 Sep 2023 08:22:57 +0000 NePo 243@/discussions if(getAnimation=='someAnimation')
setAnimation('one');
else setAnimation('two');

What do you think?]]>
Sprites temporarily invisible http://forum.gamequeryjs.com/discussion/240/sprites-temporarily-invisible Sun, 08 Sep 2023 09:52:56 +0000 404bennotfound 240@/discussions http://jsfiddle.net/XgHvD/

Start the game, then click a few times. The function that spawns the cards is on line 44.

As you can see here, whenever a sprite is created during runtime, it is invisible for about a second. Yet the missiles in the tutorial do not suffer from this problem. What are we missing?

I managed to improve it a bit from what it shown here by moving the spawning from the click event into the main loop, using the event to set a flag instead of spawning directly. But it's still painfully delayed, and all the other graphics that we add dynamically have the same problem. What's up?]]>
Pixel collision? http://forum.gamequeryjs.com/discussion/221/pixel-collision Sat, 17 Aug 2023 21:23:06 +0000 l3ecool 221@/discussions


]]>
animation slower the longer game is played http://forum.gamequeryjs.com/discussion/220/animation-slower-the-longer-game-is-played Sat, 17 Aug 2023 20:41:03 +0000 phow4806 220@/discussions I have made my first game based mainly on the tutorial and ThunderFight20xx. Everything works pretty well, but it I am finding after playing for about 2 minutes that the animations start to freeze and stick on the screen.

My script is http://www.dancingintheair.com/website/js/xwinggame.js

and then game can be accessed from this page http://www.dancingintheair.com/website/pages/xwing.html

it is all part of a uni assignment I am completing in designing and interactive site and the game has become one of my main interactive features.

I have played the game on Firefox and Safari where it runs well for 2 minutes and then the above problem occurs, testing on IE 9 & 10 and Google Chrome the problem almost starts immediately.

Any thoughts and suggestions would be greatly appreciated.]]>
Need help with simple questions... http://forum.gamequeryjs.com/discussion/176/need-help-with-simple-questions Sun, 28 Jul 2023 16:45:11 +0000 kenny11 176@/discussions first i`m sorry for these simple questions but it`ll help me...
My first question is how to do simple move WASD. I tryed to understand it in this tutorial but I`m don`t understand it. http://gamequeryjs.com/documentation/first-tutorial/
My second question is how to collide player with map layers like in this image http://opengameart.org/sites/default/files/archive/tiled-qt-screenshot-3.png

Thanks alot for answers..
Hello from Czech Republic, Kenny]]>
transition an empty div element behind main game characters http://forum.gamequeryjs.com/discussion/200/transition-an-empty-div-element-behind-main-game-characters Tue, 13 Aug 2023 05:35:15 +0000 blackhawx 200@/discussions I know that we can transition a sprite, which usually picks up its identity from an image file, onto the screen as a playground object. But is it possible to either set a group or a sprite as an empty div block, and then transition that div block from left to right across the screen?

The reason being is that I am testing out background image performances. If I could transition a < div> element that has a width & height of 700px pixels, and set a class on that div block that loads a background image, then I could see if that will be a smoother performance during my game.

At the moment, when I try to add an animating background sprite image to my code, it makes the entire game slow down dramatically. And the file is only 7kb. I'm telling the sprite to transition within a registry call back function as you have in your demos.

Looking for ideas

Thanks!
bh
]]>
Wrong POSY for sprite... http://forum.gamequeryjs.com/discussion/164/wrong-posy-for-sprite Thu, 13 Jun 2023 14:47:28 +0000 DennMonn 164@/discussions I just added one sprite to background (one blue image on black BG) and it is not set at the top of the playground! It is moved by 15px down! I tried to add posy:0 - the same bug. When I added posy:-15 - it was at the right place!
Why ? You can see it here: http://www.avizinfo.md/gametest/as001/

Thanks.]]>
gameQuery Platformer Collision http://forum.gamequeryjs.com/discussion/123/gamequery-platformer-collision Wed, 24 Apr 2024 08:42:35 +0000 eddiebees 123@/discussions
Our current code is here: (see full resources below)]]>
Trouble with collision http://forum.gamequeryjs.com/discussion/172/trouble-with-collision Thu, 18 Jul 2023 03:43:26 +0000 monkeyavalanche 172@/discussions
I have read and tried what was written on other threads about collision I but still can't get collision to work right. Do I need to place the .collision() inside the .registerCallback()? That's the only way I get collision with my player sprite and tilemaps, but only once, when my player sprite moves away It doesn't detec collision anymore. ]]>
(Possible) problem encountered while scrolling imported tilemaps by using xy() function provided http://forum.gamequeryjs.com/discussion/169/possible-problem-encountered-while-scrolling-imported-tilemaps-by-using-xy-function-provided Mon, 01 Jul 2023 11:23:10 +0000 Neonmori 169@/discussions
In a word, the imported tilemaps cannot be moved with negative coordinates when it's size is larger than the playground.

So, is this a real issue in gQ or a flaw of my idea?]]>
How can i create various playgrounds in same html page http://forum.gamequeryjs.com/discussion/163/how-can-i-create-various-playgrounds-in-same-html-page Thu, 13 Jun 2023 05:08:53 +0000 Borja 163@/discussions Some noob questions... http://forum.gamequeryjs.com/discussion/86/some-noob-questions Sun, 02 Dec 2023 11:11:02 +0000 pixeldublu 86@/discussions My Game is getting slow in Chrome http://forum.gamequeryjs.com/discussion/130/my-game-is-getting-slow-in-chrome Sat, 18 May 2024 08:54:03 +0000 dievez 130@/discussions fliph() http://forum.gamequeryjs.com/discussion/96/fliph Thu, 14 Feb 2024 05:12:43 +0000 NePo 96@/discussions .addSprite(name2,{animation: car, posx: carx, posy: cary, width: carw, height: carh}).fliph(true);
But it does not work as expected.

What I expected: flip image/mirror image horizontally

What really happened: It not only flips image but all logic too. Left side is not zero any more and if you want to move from left to right you need to decrease x instead of increasing it.

I want to let user to move object left and right and use the same animation, so its sounds logical just flip the same image instead of drawing new one...
Is there a solution for this?


]]>
prevent scroll page with arrow keys http://forum.gamequeryjs.com/discussion/129/prevent-scroll-page-with-arrow-keys Fri, 10 May 2024 05:07:28 +0000 Borja 129@/discussions I tested this code:

document.onkeydown = function(evt) {
evt = evt || window.event;
var keyCode = evt.keyCode;
if (keyCode >= 37 && keyCode <= 40) {
evt.preventDefault();
return false;
}
};

Works in firefox and IE but not in chrome.]]>
How can i make a ranking page http://forum.gamequeryjs.com/discussion/128/how-can-i-make-a-ranking-page Mon, 06 May 2024 03:45:57 +0000 Borja 128@/discussions
Thanks.]]>
can't shoot and move at same time http://forum.gamequeryjs.com/discussion/127/can-t-shoot-and-move-at-same-time Fri, 03 May 2024 04:25:22 +0000 Borja 127@/discussions When moving, the shot key does not work.
when pressed shoot key the player is shooting continuously and if i press an arrow key to move, the player stop shooting and moves. ]]>