Thank you for the link, I'll definitely use these. They look good.
So just to be clear what I am doing in terms of adding jokers...
When I create the stock using the jpg (in which the Jokers are alone on a 5th row in the same columns as the 2's and 3's), I still reference the entire row as having 13 images just like the first 4. However, since I will only list values 2 and 3 on the 5th row among the "create cards" coding in the game.php file, those blanks won't exist in my deck, right? If I am right, would anyone be so kind as to tell me if my game.php I created below is written correctly?
My stock code would look like this in .js:
Code: Select all
// Create cards types:
for (var color = 1; color <= 5; color++) {
for (var value = 2; value <= 14; value++) {
// Build card type id
var card_type_id = this.getCardUniqueId(color, value);
this.playerHand.addItemType(card_type_id, card_type_id, g_gamethemeurl + 'img/cards.jpg', card_type_id);
}
}
My game.php would look like this creating a deck with Jokers:
Code: Select all
// Create cards
$cards = array ();
for ($color = 1; $color <= 4; $color ++) {
// spade, heart, diamond, club
for ($value = 2; $value <= 14; $value ++) {
// 2, 3, 4, ... K, A
$cards [] = array ('type' => $color,'type_arg' => $value,'nbr' => 4 );
// 208 cards total 52 card deck times 4
}
}
for ($color = 5) {
//Joker "suit" (row on img file)
for ($value = 2; $value <= 3; $value ++) {
// red joker, black joker
$cards [] = array ('type' => $color, 'type_arg' => $value,'nbr' => 4 );
// 8 cards total: 4 red jokers, 4 black jokers
}
}
// 216 cards total
$this->cards->createCards( $cards, 'deck' );