Przedszkolak
Postów: 4
v7.02.01 Data rejestracji: 14.08.2010 16:38
ZBANOWANY: Dożywotnio
|
Dzien dobry mam pytanie jak zrobic aby ten kod:
array(
0 => array(
'Image' => 'wall001_right_bottom.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
2 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
3 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
4 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
5 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
6 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
7 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
8 => array(
'Image' => 'wall001_bottom.png',
'CanBeOn' => false
),
9 => array(
'Image' => 'wall001_left_bottom.png',
'CanBeOn' => false
)
),
1 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
2 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
3 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
4 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
5 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
6 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
7 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
8 => array(
0 => array(
'Image' => 'wall001_right.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
2 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
3 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
4 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
5 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
6 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
7 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
8 => array(
'Image' => 'grass.png',
'CanBeOn' => true
),
9 => array(
'Image' => 'wall001_left.png',
'CanBeOn' => false
)
),
9 => array(
0 => array(
'Image' => 'wall001_right_top.png',
'CanBeOn' => false
),
1 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
2 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
3 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
4 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
5 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
6 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
7 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
8 => array(
'Image' => 'wall001_top.png',
'CanBeOn' => false
),
9 => array(
'Image' => 'wall001_left_top.png',
'CanBeOn' => false
)
)
);
?>
$Value) {
// $Key2 zawiera wspolrzedna X, a $Value2 to tablica zawierajaca informacje o podlozu oraz o tym czy na dane pole mozna wejsc
foreach($Value as $Key2 => $Value2) {
$EchoString[0] = '';
// Jesli mozna wejsc na pole
if($Value2['CanBeOn'] === true) {
// Generowanie "strzaleczek"
if($Key - 1 == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '';
} else if($Key + 1 == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '';
} else if($Key2 - 1 == $YX['x'] && $Key == $YX['y']) {
$EchoString[1] = '';
} else if($Key2 + 1 == $YX['x'] && $Key == $YX['y']) {
$EchoString[1] = '';
} else if($Key == $YX['y'] && $Key2 == $YX['x']) {
$EchoString[1] = '';
} else {
$EchoString[1] = '';
}
} else {
$EchoString[1] = '';
}
echo implode('', $EchoString);
}
echo '';
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
Mozna edytowac przez panel admina chodzi mi o zmiane adresów obrazków oraz zmiane funkcji na true lub false
Edytowane przez Pieka dnia 21.12.2010 18:01:39
|