Hi to all , first time posting here something .
I am trying to make a simple card game but i am having a problem with the " Hand Loop code "
just so you understand i am using Ds_lists , and when i click deck , it should read the last card value from the ds_list , save it on a variable called "topcard" and then read the Hand ( if there is any card already on the hand ) and add it.
so i have the following code on Left Button Press on object deck
now the loop is not working because hand[0] , hand[1] when drawn , stay all with the same value..
the draw event is below:
Can you guys help figuring out the problem?
thanks !
I am trying to make a simple card game but i am having a problem with the " Hand Loop code "
just so you understand i am using Ds_lists , and when i click deck , it should read the last card value from the ds_list , save it on a variable called "topcard" and then read the Hand ( if there is any card already on the hand ) and add it.
so i have the following code on Left Button Press on object deck
GML:
global.handsize +=1
global.topcard = ds_list_find_value(global.playerdeck,0 );
ds_list_delete(global.playerdeck, 0);
for(var u=0; u<global.handsize; u++){
global.hand[u] =global.topcard
}
the draw event is below:
GML:
draw_text(5,200,global.hand[0])
draw_self()
for(var f=0; f<global.handsize; f++){
draw_text(5+(100*f), 200, global.hand[f]);
}
thanks !