View Full Version : Q about graphics in game script / naive newbie
markgriffith
05-17-2009, 12:22 AM
.
I'm looking at an old Javascript script for the game Concentration, where small images of honey bees, flowers, fish etc are hidden under tiles.
Obviously, this is very naive of me - I'm a total beginner, but I cannot see how the images are loaded into the script. I suppose they're hidden under some 'array' term in a way I don't understand.
This is an old Brian Gosselin script for the game where he gives the script away free, so once again, my silly question is - where are the little pictures in the script!? I see only one .gif mentioned.
Thanks and apologies,
Mark
.
Andyram2k
05-17-2009, 12:42 AM
Hi Mark,
The images are included in the starting array, and then loaded in within the init function:
function init(){
clearTimeout(id);
for(i=0;i<=35;i++)user[i]=0;
ticker=0; min=0; sec=0; ctr=0; finished=0;
oktoclick=true;
document.forms["f"].b.value="Resetting game table...";
scramble();
id=setInterval('runclk()', 995);
for(i=0;i<=35;i++){
document.images[('img'+i)].src="image0.gif";
document.images[('img'+i)].alt="";}}
http://gtscript.com/download-scripts-for-free/Concentration-5446.html
So if you wanted to change the graphics, do so by changing the images included in the download. Hope this helps :)
- Andy.
markgriffith
05-17-2009, 02:40 AM
.
Dear Andy, thanks - that's very kind!
Yes, I thought something mysterious {at least mysterious to me} was happening with images being hidden in the initial array.
I suppose I should actually download that code and see what comes with it instead of just sitting here looking at it on the internet!
You've probably just helped me see past my own confusion there....
Gratefully,
Mark
.
markgriffith
05-17-2009, 02:41 AM
.
.....yes, changing the tile images was just what I was hoping to do, to build a vocabulary learning game for foreign languages....
Anyway, to action.
Andyram2k
05-17-2009, 12:42 PM
Cool have fun :)
- Andy
markgriffith
06-06-2009, 02:23 AM
.
Dear Andyram,
I wanted to thank you for your encouragement. About four days after you posted, so about 10 days ago, I downloaded the code, found the graphics file, redid the graphics into coloured Russian words with English translations, increased the size of the buttons, and got it to work.
Now obviously, this is not much of an accomplishment in coding terms! Apart from inserting a 'not' into the text {these graphics were not designed by my wife, because of course I am not Brian} I did nothing else, and still don't really understand any of the detail.
But I'd like to post the new script/game on this thread.... if I knew how. Do I just attach the .zip file? All terribly basic still, I'm afraid.
I guess I must accept advancing in small steps...
Gratefully,
Mark
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.