PDA

View Full Version : game not showing properly...



tpgames
Jan 18th, 2007, 05:33 PM
Can't edit title, but I've solved this problem. LOL See last post. (I had forgotten to sign in as well, so didn't see edit tags. LOL Just call me TPDunce. LOL)

I found a memory game that I could use to compare apples to oranges for the educational part of my site, but I can't get the game to show up properly. The original game works on many different browsers, but when I put in my own images, that are 200 x 200, and change the column and row numbers, the game doesn't show up right. Originally, the game used only 0 - 17 arrays. I wanted 0 - 26 arrays, but being that they want and even number and had the code for row x columns, I went with 30 arrays total, thus 0 - 29.

VWPhillip's game works for all the other type of memory games, but can't figure out how to alter that one for education so trying to modify the original educational memory game. I'm trying to compare the Capital letters of the alphabet with the small case letters. Another game I found is not modifiable at all and only has 9 images max per game.

Here's the link:
http://www.tpgames.net/gaming/2/memory/MemoryWORK/jyzmemwork.html

The code is too long to post. Sorry! But here is part of the code:



var variable = window.name;
if (variable=='')
{
var num_rows = 5;
var num_columns = 6;
}
else
{
var temp1=variable.lastIndexOf("c");
var num_rows=variable.slice(1,temp1);
var num_columns=variable.slice(temp1+1,variable.length);
}

var num_fields=num_rows * num_columns;
var num_pics=num_rows * num_columns/2;
var opened_pics=0;
var firstclick=0;
var pic1;
var pic2;
var start_time;
var end_time;
var firstimage=0;
var first_clicked_image=0;
var image_number;
var attempts=0;
var allow_click=1;

var last_image=29;

var covered=new Image;covered.src="/gaming/2/memory/MemoryWORK/q/covered.jpg";
var bild=new Array();

bild[0]=new Array(2);
bild[0]["nick"]=new Image;bild[0]["nick"].src="/gaming/2/memory/MemoryWORK/q/101.gif";
bild[0]["avatar"]=new Image;bild[0]["avatar"].src="/gaming/2/memory/MemoryWORK/q/201.gif";
bild[1]=new Array(2);
bild[1]["nick"]=new Image;bild[1]["nick"].src="/gaming/2/memory/MemoryWORK/q/102.gif";
bild[1]["avatar"]=new Image;bild[1]["avatar"].src="/gaming/2/memory/MemoryWORK/q/202.gif";






function loadmemory()
{
var start=0;

if (document.spiel.settings[0].checked == true) { game="r4c4";start=1; }
if (document.spiel.settings[1].checked == true) { game="r4c6";start=1; }
if (document.spiel.settings[2].checked == true) { game="r5c6";start=1; }

window.name=game;
location.reload();
}



What I gave up on:
I tried altering a copy of Vic's memory game to compare apples to oranges and that was a complete failure. I don't know what code to use to tell script new Array(12) is what it wants. I'm not even sure if the rest of his script would work with the concept either. So...

This is that code:



zxcSelAry[7]=['Audio Series','http://i107.photobucket.com/albums/m287/tpkyteroo/zgames/memory/audio1/',ImgAry7];

zxcSelAry[8]=['Educate',HERE IS SUPPOSE TO BE LINK TO IMAGES,new Array(12)];

var bild=new Array();
new Array(12)=zxcSelAry[8]


bild[0]=new Array(12);
bild[0]["nick"]=new Image;bild[0]["nick"].src="/gaming/2/memory/MemoryWORK/q/101.gif";
bild[0]["avatar"]=new Image;bild[0]["avatar"].src="/gaming/2/memory/MemoryWORK/q/201.gif";
bild[1]=new Array(12);
bild[1]["nick"]=new Image;bild[1]["nick"].src="/gaming/2/memory/MemoryWORK/q/102.gif";
bild[1]["avatar"]=new Image;bild[1]["avatar"].src="/gaming/2/memory/MemoryWORK/q/202.gif";
bild[2]=new Array(12);
bild[2]["nick"]=new Image;bild[2]["nick"].src="/gaming/2/memory/MemoryWORK/q/103.gif";
bild[2]["avatar"]=new Image;bild[2]["avatar"].src="/gaming/2/memory/MemoryWORK/q/203.gif";
bild[3]=new Array(12);
bild[3]["nick"]=new Image;bild[3]["nick"].src="/gaming/2/memory/MemoryWORK/q/104.gif";
bild[3]["avatar"]=new Image;bild[3]["avatar"].src="/gaming/2/memory/MemoryWORK/q/204.gif";
bild[4]=new Array(12);
bild[4]["nick"]=new Image;bild[4]["nick"].src="/gaming/2/memory/MemoryWORK/q/105.gif";
bild[4]["avatar"]=new Image;bild[4]["avatar"].src="/gaming/2/memory/MemoryWORK/q/205.gif";
bild[5]=new Array(12);
bild[5]["nick"]=new Image;bild[5]["nick"].src="/gaming/2/memory/MemoryWORK/q/106.gif";
bild[5]["avatar"]=new Image;bild[5]["avatar"].src="/gaming/2/memory/MemoryWORK/q/206.gif";



The Link to that one:
http://www.tpgames.net/gaming/2/memory/MemoryWORK/jyzvicmem.html

:D Thanks in Advance!

tpgames
Jan 18th, 2007, 06:08 PM
It's the size of my images that is the problem, but how does one go about fixing the code to accomodate my image sizes?

I just figured this much out. When I made a new program and used just his 17 arrays, but my images, I got the same messed up look. I only get this mess up look if I choose Advanced, or Professional game options.

Changing the rows and columns to 4 and 4 does not solve the problem.

tpgames
Jan 18th, 2007, 09:05 PM
I wish I could delete or edit posts in this forum. It would save a lot of people a lot of unnecessary reading. LOL

Turns out it was the Table tag with a preset width that was causing the problem. I had thought of this on the way to coffee shop. LOL

It would probably be helpful if I figure out how to change the code such that it automatically used 5 columns for professional and advance instead of the 6. I think I can figure that much out. LOL :D

tpgames
Feb 1st, 2007, 04:11 AM
I figured out how many col and rows I needed for all 3 levels.
And, my A-Z compared to a-z works with one picture added to get the right number of cards I needed. The game does lack a random card picker generator, which I thought was a bad thing, but am now thinking is a good thing, because of the different levels, can mean harder cards as well, not just more cards.