I have the different windows working now and they display the card pictures right. The last question I have is if I'm doing it in the shortest amount of lines possible.
PANEL* PlayersHand =
{
layer = 5;
window(180,790,140,218,GameCards2,382,0);
window(370,790,140,218,GameCards2,PictureX[1],0);
window(560,790,140,218,GameCards2,PictureX[2],0);
window(750,790,140,218,GameCards2,PictureX[3],0);
window(940,790,140,218,GameCards2,PictureX[4],0);
}
function main()
{
video_mode = 9;
video_screen = 1;
mouse_map = MousePointer;
mouse_mode = 4;
mouse_sync = 1;
set (PlayingBackground, SHOW);
set (OpponentsField, SHOW);
set (PlayersField, SHOW);
set (PlayersHand, SHOW);
}
function GameStart()
{
Count = 0;
for (Count; Count <= 24; Count++)
{
if (Count <= 2)
{
CardCountUnc[Count] = 18;
}
else if (Count == 3) // Setup of unchanged card number array
{
CardCountUnc[Count] = 10;
}
else
{
CardCountUnc[Count] = 2;
}
}
Count = 0;
for (Count; Count <= 24; Count++)
{
CardCountCha[Count] = CardCountUnc[Count]; // Setup of changed card number array
}
random_seed(0);
Count2 = 0;
Count = 0;
CardNumberZero = 1;
for (Count2; Count2 <= 4; Count2++)
{
while (CardNumberZero == 1)
{
CardDrawNumber = rand() % 24; // Deal out players hand
for (Count; Count <= 24; Count++)
{
if (CardDrawNumber == Count)
{
if (CardCountCha[Count] > 0)
{
PlayerHand[Count2] = CardDrawNumber;
CardCountCha[Count]--;
CardNumberZero = 0;
ChangeCardImage(CardDrawNumber,Count2);
}
}
}
}
CardNumberZero = 1;
Count = 0;
}
}
function ChangeCardImage(Number,HandNumber)
{
switch (Number)
{
case 0:
PictureX[HandNumber] = 135;
break;
case 1:
PictureX[HandNumber] = 263;
break;
case 2:
PictureX[HandNumber] = 382;
break;
}
}
Last edited by Dominator; 08/14/09 16:33. Reason: Figured out how to make ChangeCardImage more efficient