B
bondfish
Guest
I am trying to create a simple program in which you draw cards from a deck randomly and when they show up they get deleted until there are no cards left. I got them to show up randomly but need help deleting them.
here is the code.
CREATE:
//52 is showing the back of the cards at the start
image_index = 52;
image_speed = 0;
STEP:
space = keyboard_check_pressed(vk_space);
card_number = random(51)
//ds list
deck = ds_list_create();
for( var i = 0; i<51; i++)
{
ds_list_add(deck,i);
}
ds_list_shuffle(deck);
//Random card shown
if(space){
image_index = ds_list_find_value(deck, card_number);
}
here is the code.
CREATE:
//52 is showing the back of the cards at the start
image_index = 52;
image_speed = 0;
STEP:
space = keyboard_check_pressed(vk_space);
card_number = random(51)
//ds list
deck = ds_list_create();
for( var i = 0; i<51; i++)
{
ds_list_add(deck,i);
}
ds_list_shuffle(deck);
//Random card shown
if(space){
image_index = ds_list_find_value(deck, card_number);
}