A
AndrewCampbell
Guest
Cant for the life of me figure out why this isn't working, and I'm sure the answer is simple.
Here is the code below, the card var is supposed to change when pressed, but both of their values are staying null (0) when pressed. The error I believe has to be within the step event for that to be the case. Anyway, here is the code.
Create
Step
Draw
No error messages show when running, but var card1 and card2 do not change
Thanks in advance -
Andrew C
Here is the code below, the card var is supposed to change when pressed, but both of their values are staying null (0) when pressed. The error I believe has to be within the step event for that to be the case. Anyway, here is the code.
Create
Code:
//Set Vars
card1 = 0;
card2 = 0;
Code:
if (card2 = 0 && card1 != 0)
{
if (mouse_check_button(mb_any) && (0 < mouse_x > 200) && (0 < mouse_y > 210))
{
card2 = cardSpadesA;
}
if (mouse_check_button(mb_any) && (201 < mouse_x > 350) && (0 < mouse_y > 210))
{
card2 = cardSpadesK;
}
if (mouse_check_button(mb_any) && (351 < mouse_x > 500) && (0 < mouse_y > 210))
{
card2 = cardSpadesQ;
}
if (mouse_check_button(mb_any) && (501 < mouse_x > 650) && (0 < mouse_y > 210))
{
card2 = cardSpadesJ;
}
if (mouse_check_button(mb_any) && (651 < mouse_x > 800) && (0 < mouse_y > 210))
{
card2 = cardSpades10;
}
if (mouse_check_button(mb_any) && (801 < mouse_x > 960) && (0 < mouse_y > 210))
{
card2 = cardSpades9;
}
if (mouse_check_button(mb_any) && (961 < mouse_x > 1100) && (0 < mouse_y > 210))
{
card2 = cardSpades8;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 200) && (0 < mouse_y > 400))
{
card2 = cardSpades7;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 350) && (0 < mouse_y > 400))
{
card2 = cardSpades6;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 500) && (0 < mouse_y > 400))
{
card2 = cardSpades5;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 650) && (0 < mouse_y > 400))
{
card2 = cardSpades4;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 800) && (0 < mouse_y > 400))
{
card2 = cardSpades3;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 950) && (0 < mouse_y > 400))
{
card2 = cardSpades2;
}
}
if card1 = 0
{
if (mouse_check_button(mb_any) && (0 < mouse_x > 200) && (0 < mouse_y > 210))
{
card1 = cardSpadesA;
}
if (mouse_check_button(mb_any) && (201 < mouse_x > 350) && (0 < mouse_y > 210))
{
card1 = cardSpadesK;
}
if (mouse_check_button(mb_any) && (351 < mouse_x > 500) && (0 < mouse_y > 210))
{
card1 = cardSpadesQ;
}
if (mouse_check_button(mb_any) && (501 < mouse_x > 650) && (0 < mouse_y > 210))
{
card1 = cardSpadesJ;
}
if (mouse_check_button(mb_any) && (651 < mouse_x > 800) && (0 < mouse_y > 210))
{
card1 = cardSpades10;
}
if (mouse_check_button(mb_any) && (801 < mouse_x > 960) && (0 < mouse_y > 210))
{
card1 = cardSpades9;
}
if (mouse_check_button(mb_any) && (961 < mouse_x > 1100) && (0 < mouse_y > 210))
{
card1 = cardSpades8;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 200) && (0 < mouse_y > 400))
{
card1 = cardSpades7;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 350) && (0 < mouse_y > 400))
{
card1 = cardSpades6;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 500) && (0 < mouse_y > 400))
{
card1 = cardSpades5;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 650) && (0 < mouse_y > 400))
{
card1 = cardSpades4;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 800) && (0 < mouse_y > 400))
{
card1 = cardSpades3;
}
if (mouse_check_button(mb_any) && (0 < mouse_x > 950) && (0 < mouse_y > 400))
{
card1 = cardSpades2;
}
}
Code:
//Draw Cards
draw_sprite_ext(cardSpadesA,0,60,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpadesK,0,210,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpadesQ,0,360,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpadesJ,0,510,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades10,0,660,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades9,0,810,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades8,0,960,50,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades7,0,60,230,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades6,0,210,230,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades5,0,360,230,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades4,0,510,230,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades3,0,660,230,.75,.75,0,-1,1);
draw_sprite_ext(cardSpades2,0,810,230,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamondsA,0,60,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamondsK,0,210,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamondsQ,0,360,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamondsJ,0,510,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds10,0,660,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds9,0,810,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds8,0,960,410,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds7,0,60,590,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds6,0,210,590,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds5,0,360,590,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds4,0,510,590,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds3,0,660,590,.75,.75,0,-1,1);
draw_sprite_ext(cardDiamonds2,0,810,590,.75,.75,0,-1,1);
draw_sprite_ext(cardClubsA,0,60,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubsK,0,210,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubsQ,0,360,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubsJ,0,510,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs10,0,660,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs9,0,810,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs8,0,960,770,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs7,0,60,950,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs6,0,210,950,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs5,0,360,950,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs4,0,510,950,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs3,0,660,950,.75,.75,0,-1,1);
draw_sprite_ext(cardClubs2,0,810,950,.75,.75,0,-1,1);
draw_sprite_ext(cardHeartsA,0,60,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHeartsK,0,210,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHeartsQ,0,360,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHeartsJ,0,510,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts10,0,660,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts9,0,810,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts8,0,960,1130,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts7,0,60,1310,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts6,0,210,1310,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts5,0,360,1310,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts4,0,510,1310,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts3,0,660,1310,.75,.75,0,-1,1);
draw_sprite_ext(cardHearts2,0,810,1310,.75,.75,0,-1,1);
//Number of Players
draw_text_ext_transformed(50,1520,"Number of Players",1,500,1.8,1.8,0);
draw_sprite_ext(grey_sliderLeft,0,350,1510,2,2,0,-1,1);
draw_sprite_ext(grey_sliderRight,0,690,1510,2,2,0,-1,1);
//Board
draw_text_ext_transformed(50,1640,"Hand",1,500,1.8,1.8,0);
draw_text_ext_transformed(360,1640,"Flop",1,500,1.8,1.8,0);
draw_text_ext_transformed(810,1640,"Turn",1,500,1.8,1.8,0);
draw_text_ext_transformed(960,1640,"River",1,500,1.8,1.8,0);
//Card 1
if card1 != 0
{
draw_sprite_ext(card1,0,60,1710,.75,.75,0,-1,1);
}
if card2 != 0
{
draw_sprite_ext(card2,0,210,1710,.75,.75,0,-1,1);
}
draw_set_color(c_white)
draw_text_ext_transformed(50,1800,"card 1 = " + string(card1),1,500,1.8,1.8,0);
draw_text_ext_transformed(300,1800,"card 2 = " + string(card2),1,500,1.8,1.8,0);
/*
draw_sprite_ext(cardJoker,0,360,1710,.75,.75,0,-1,1);
draw_sprite_ext(cardJoker,0,510,1710,.75,.75,0,-1,1);
draw_sprite_ext(cardJoker,0,660,1710,.75,.75,0,-1,1);
draw_sprite_ext(cardJoker,0,810,1710,.75,.75,0,-1,1);
draw_sprite_ext(cardJoker,0,960,1710,.75,.75,0,-1,1);
*/
Thanks in advance -
Andrew C