My question is how should I work the placing of cards and the checking of points adjecent cards points?
Currently I have it so the grid is an array like this:
Code: Select all
<?php
$map = array (
array ( 0, 0, 0, 0 ),
array ( 0, 0, 0, 0 ),
array ( 0, 0, 0, 0 ),
array ( 0, 0, 0, 0 ),
);
?>The data of the cards is stored in an array like this (all we really care about for this problem are the last 8 keys):
Code: Select all
<?php
$card1 = array ( name => "Monsieus",
type => "fire",
age => 2,
attack => 2,
defence => 1,
ul => 0,
u => 1,
ur => 0,
l => 1,
r => 1,
bl => 0,
b => 1,
br => 0 );
?>So the first problem is I don't know how to assign a card to a spot on the grid. should I just put that array into the map's array and make it 3 dimentional? Can I just say like
Code: Select all
<?php
$map[0][0] = $card1
?>And I have no clue on how I would check for points. Any suggestions would be appriated, no code is needed, just kinda suggestions on how I should approach this problem.