Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-16-2009, 11:22 PM   PM User | #1
markgriffith
New to the CF scene

 
Join Date: May 2009
Location: Budapest, Hungary
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
markgriffith is an unknown quantity at this point
Q about graphics in game script / naive newbie

.

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

.
markgriffith is offline   Reply With Quote
Old 05-16-2009, 11:42 PM   PM User | #2
Andyram2k
New to the CF scene

 
Join Date: Apr 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Andyram2k is an unknown quantity at this point
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...tion-5446.html

So if you wanted to change the graphics, do so by changing the images included in the download. Hope this helps

- Andy.

Last edited by Andyram2k; 05-16-2009 at 11:46 PM..
Andyram2k is offline   Reply With Quote
Old 05-17-2009, 01:40 AM   PM User | #3
markgriffith
New to the CF scene

 
Join Date: May 2009
Location: Budapest, Hungary
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
markgriffith is an unknown quantity at this point
.

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 is offline   Reply With Quote
Old 05-17-2009, 01:41 AM   PM User | #4
markgriffith
New to the CF scene

 
Join Date: May 2009
Location: Budapest, Hungary
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
markgriffith is an unknown quantity at this point
.

.....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.
markgriffith is offline   Reply With Quote
Old 05-17-2009, 11:42 AM   PM User | #5
Andyram2k
New to the CF scene

 
Join Date: Apr 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Andyram2k is an unknown quantity at this point
Cool have fun

- Andy
Andyram2k is offline   Reply With Quote
Old 06-06-2009, 01:23 AM   PM User | #6
markgriffith
New to the CF scene

 
Join Date: May 2009
Location: Budapest, Hungary
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
markgriffith is an unknown quantity at this point
.

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
markgriffith is offline   Reply With Quote
Reply

Bookmarks

Tags
array, game, gosselin, graphics, newbie

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:13 AM.


Advertisement
Log in to turn off these ads.