Development - gameQuery's community http://forum.gamequeryjs.com/categories/development/feed.rss Mon, 16 Mar 2024 19:58:37 +0000 Development - gameQuery's community en-CA Scrolling the tilemap by user movement http://forum.gamequeryjs.com/discussion/238/scrolling-the-tilemap-by-user-movement Sat, 31 Aug 2023 01:56:04 +0000 lortschi 238@/discussions
I have a position problem with my player sprite after the tilemap has scrolled. Here is my code: http://lortschi.de/games/bd/
The playground is smaller created as the tilemap. So I can move the tilemap in the opposing direction when the player reached at a certain point on the map. In this case is the 800px mark. In my code is this the scrollStage function at line 196.
The curios problem after the map movement is, that my player sprite position isn't updated by the playground. I try to move my group where the sprite added to simmilar with the tilemap together. But it doesn't helps anymore. After the map movement my player staying on the right place but the playground thinks he has the old position couple of pixels behind them.
I have tryed everything but I couldn't solve this problem. Please help my Selim :)

Thank you in advance! ]]>
To get the next bottom element of a selected tile out of the tilemap http://forum.gamequeryjs.com/discussion/175/to-get-the-next-bottom-element-of-a-selected-tile-out-of-the-tilemap Wed, 24 Jul 2023 02:06:03 +0000 lortschi 175@/discussions how can I get the next bottom element (id, class) of a selected tile without to loop through the whole tilemap? ]]> Proper way to set the z-index of any sprite we add later in the game http://forum.gamequeryjs.com/discussion/67/proper-way-to-set-the-z-index-of-any-sprite-we-add-later-in-the-game Fri, 07 Sep 2023 14:30:11 +0000 blackhawx 67@/discussions
For example, on keypress, I have added a sprite, but now need it to be first in the group.

thanks!
]]>
Is there a way to recall the current animation set on a sprite? http://forum.gamequeryjs.com/discussion/111/is-there-a-way-to-recall-the-current-animation-set-on-a-sprite Sat, 16 Mar 2024 07:48:31 +0000 TNizz1e 111@/discussions
I was just wanting a way that I could say - if the animation isn't currently set to what it should be, then set it, if is it, leave it alone. If there isn't anything built into gQ itself I'm thinking the best way to do this would be testing the background-image property of the sprite?

Thanks in advance for any help :)

Tom]]>
Collision with tiles http://forum.gamequeryjs.com/discussion/62/collision-with-tiles Tue, 28 Aug 2023 12:16:40 +0000 cristio211 62@/discussions Hello,

I can't figure out how to check if my player runs into a tile generated by the Tile Map Editor.

I tried to check if my player collides with the tileType 1:

var collided = $("#player").collision("#tilemap,."+ $.gameQuery.tileTypePrefix + 1 );
if(collided.length > 0){
...
}


]]>
Aim N Shoot Question #3 http://forum.gamequeryjs.com/discussion/108/aim-n-shoot-question-3 Fri, 22 Feb 2024 23:59:48 +0000 MinDev 108@/discussions 1. Enemy - Detecting the closest ally/player and choosing which one to attack (sure - the closest one, or, with smarter AI - the strongest[most damaging] one)
2.Ally - in battles with multiple enemies allies also will have to choose closest or strongest enemies to attack.

For example:
I am playing with NPC ally and two enemies.
The script returned random number for ally behavior to walk to and stab closest enemy.
If there would be no closest enemy detecting, then ally will go stabbing one enemy, then another - damage is simply random, like a number. We should make ally first kill one closest enemy then go finish others.

So how to make closest enemy/ally detection, and sure, his x, y detection?]]>
Aim N Shoot question #2: http://forum.gamequeryjs.com/discussion/106/aim-n-shoot-question-2 Thu, 21 Feb 2024 21:34:27 +0000 MinDev 106@/discussions I have a bit newbieish question:
How to make projectile to move in line, for example I am aiming (current mouse position) into sky tile to destroy enemy attack chopper which is in projectile trajectory but is further than sky tile?
]]>
Can gameQueryJS able to use 2d sprite instead of horizontal or vertical sprite ? http://forum.gamequeryjs.com/discussion/100/can-gamequeryjs-able-to-use-2d-sprite-instead-of-horizontal-or-vertical-sprite Mon, 18 Feb 2024 23:22:24 +0000 EdsTan 100@/discussions Normally the sprite use in developing game using gameQueryJS is either Vertical or Horizontal.
Is it possible for gameQueryJS to use 2D sprite ?]]>
Looking for more soundmanager examples with gameQuery http://forum.gamequeryjs.com/discussion/101/looking-for-more-soundmanager-examples-with-gamequery Tue, 19 Feb 2024 10:46:27 +0000 blackhawx 101@/discussions ]]> New Code For 2D sprite. http://forum.gamequeryjs.com/discussion/102/new-code-for-2d-sprite Wed, 20 Feb 2024 00:32:09 +0000 EdsTan 102@/discussions
Around line 230-240

ANIMATION_GRID: 64,
Around line 200
under the "var defaults = {", add in :

columnsCount: 0,
rowHeight: 0,
startFrame: 0
And then at the bottom of "// "public" attributes:", add in :

this.columnsCount = options.columnsCount;
this.rowHeight = options.rowHeight;
this.startFrame = options.startFrame;
Around line 390-400
Add in the else-if code for the animation.

//CUSTOM FUNCTION
else if((gameQuery.animation.type & $.gameQuery.ANIMATION_GRID) && (gameQuery.animation.numberOfFrame > 1)) {


var column = (gameQuery.animation.startFrame + gameQuery.currentFrame) % gameQuery.animation.columnsCount;
var row = Math.floor((gameQuery.animation.startFrame + gameQuery.currentFrame) / gameQuery.animation.columnsCount);

//console.log(column + " " + row);
$(this).css("background-position",""+(-gameQuery.animation.offsetx-gameQuery.animation.delta*column)+"px "+(-gameQuery.animation.offsety-gameQuery.animation.rowHeight*row)+"px");

}
]]>
Unclear: .addTilemap property(!) is not defined. What is this? http://forum.gamequeryjs.com/discussion/98/unclear-addtilemap-property-is-not-defined-what-is-this Sun, 17 Feb 2024 22:19:13 +0000 MinDev 98@/discussions 1. Property not function
2. Undefined
Packed scripts,
https://sites.google.com/site/caxxxxxxx/home/atsisiuntimai/Under Attack.rar?attredirects=0&d=1

note: Found script eror using: HTML-Kit.
]]>
Aim N Shoot Question http://forum.gamequeryjs.com/discussion/97/aim-n-shoot-question Thu, 14 Feb 2024 06:52:03 +0000 MinDev 97@/discussions I know how to make script that will return x and y coordinates of the mouse/touchpad, but I dont know how to return weapon angle around player to crosshair.]]> Patern loading/using http://forum.gamequeryjs.com/discussion/95/patern-loading-using Thu, 14 Feb 2024 05:03:40 +0000 NePo 95@/discussions I need to have street in my game. Nothing special, it could be as long as 5px and then repeated all over the place there I need.
In webdesign you can set background url and then choose repeat, repeat-x, repeat-y, no-repeat.
Can we have something similar in gameQuery in near future?]]>
Auto image size http://forum.gamequeryjs.com/discussion/94/auto-image-size Thu, 14 Feb 2024 04:57:09 +0000 NePo 94@/discussions First you load it with a code like this:
var home = new $.gQ.Animation({imageURL: "img/home.png"});

And then you add it to playground with a code like this:
.addSprite("home", {animation: home, width: 92, height: 135,posx: 10, posy: 260 })

There maybe a lot of reasons why you want to set width/height by hand,
but sometimes you need to use original image size. It would be very nice if image loading function also automatically could read image width/height and if you do not set it by hand in addSprite used it. ]]>
can we develop component based on gamejquery like this engine:crafty http://forum.gamequeryjs.com/discussion/84/can-we-develop-component-based-on-gamejquery-like-this-engine-crafty Tue, 06 Nov 2023 00:46:52 +0000 frompasttofuture 84@/discussions thanks!]]> About scale() http://forum.gamequeryjs.com/discussion/74/about-scale Fri, 14 Sep 2023 01:44:29 +0000 jPan 74@/discussions
First of all gameQuery rocks!!!!!!

While i was experimenting with gameQuery i crossed the following situation.
I made a sprite but i wanted to scale it down (by a scale factor of 0.3). However the x, y of the sprite didn't change (leaving a gap between the x,y and the graphic of the sprite. Why is this happening? Is this happening by design?]]>
How to animate an item in the background across the screen only once http://forum.gamequeryjs.com/discussion/72/how-to-animate-an-item-in-the-background-across-the-screen-only-once Tue, 11 Sep 2023 07:54:59 +0000 blackhawx 72@/discussions I was looking at your page on animating background items here - http://gamequeryjs.com/documentation/first-tutorial/first-tutorial-step-1/, which makes a lot of sense if I wanted a continous sequence. But I have an additional sprite that I want to animate through the screen only one time and not cycle back into the screen again. What is the simplist way we can achieve that affect.

I tried placing type: $.gQ.ANIMATION_ONCE, on the new $.gQ.Animation I am talking about, but its still cycling the item back into the screen. Do you already have any examples of this?

Thanks!
]]>
gameQuery on Google CDN http://forum.gamequeryjs.com/discussion/12/gamequery-on-google-cdn Sat, 31 Mar 2024 13:28:46 +0000 pronoyc 12@/discussions Extending Gamequery http://forum.gamequeryjs.com/discussion/14/extending-gamequery Mon, 09 Apr 2024 14:10:42 +0000 jarodium 14@/discussions
I'm trying to extend Gamequery to create a new functionality, like some dialog windows like in those older Final Fantasy Games
I tried looking up to the docs and the sound wrapper but I don't quite understand the resourcemanager function.
It seems that if I want to do this, I would have to add a sprite or a group loaded in the resource manager like the sound wrapper does...

Am I thinking the correct way?
Regards
Pedro
]]>
requestAnimationFrame http://forum.gamequeryjs.com/discussion/5/requestanimationframe Wed, 14 Mar 2024 05:22:45 +0000 Fost 5@/discussions It's easy to do some basic tests by editing gamequery:

Search for:
setInterval(function () {
$.gameQuery.resourceManager.refresh();
},($.gameQuery.refreshRate));

and replace with:
requestAnimationFrame(function () {$.gameQuery.resourceManager.refresh();});

then add to the end of the resource manager's refresh function:

//Start the next loop render frame
requestAnimationFrame(function () {$.gameQuery.resourceManager.refresh();});

you'll also need to include the requestAnimationFrame shim:
https://gist.github.com/1579671


Supposedly DOM updates are the main performace hit in DOM based engines and using requestAnimationFrame should put them all into one repaint (if the browser is correctly doing it's thing).

This does mean that the rest of the game logic is probably best put into it's own setinterval timer - this is what I'm doing now by just running game controls in their own interval. Essentially register callback is unreliable as you have no idea how fast the requestAnimationFrame loop is running.

I can see a lot of potential perfomance inceases with this method - if all the transform methods instead store their changes and set a dirty flag on the sprite, then the refresh method is called using requestanimationFrame we could make all the DOM updates run in one repaint.

I'll see if I can add the base requestAnimationFrame changes in a way that doesn't break registerCallback(). That would be a start.
]]>
Phonegap/Mobile Plan? http://forum.gamequeryjs.com/discussion/4/phonegap-mobile-plan Tue, 13 Mar 2024 04:18:09 +0000 ojr 4@/discussions GameQuery. Future development. http://forum.gamequeryjs.com/discussion/3/gamequery-future-development Tue, 06 Mar 2024 05:25:56 +0000 Fost 3@/discussions
As of now one thing I think would help immensely would be to split jquery.gamequery.js into more files so we have a 'dev' version with (for example):
  • jquery.gamequery.core.js: Playground etc.
  • jquery.gamequery.tilemap.js: tilemap functionality
  • jquery.gamequery.transform.js: cross browser position/rotate/scale functions.
  • jquery.gamequery,animation.js: the animation objects

For one it would mean parts can be included in other projects without needing to fork the entire project and hopefully any further development and optimisation work in those modules could be pulled back.

It looks like there are ways to use github to automatically build a final jquery.gamequery.js on commit. Although I don't know much about this process.

]]>