diff --git a/solitaire.lua b/solitaire.lua index 734f694..519ecfb 100644 --- a/solitaire.lua +++ b/solitaire.lua @@ -111,15 +111,6 @@ function BOOT() end return end - - stacks[1] = create_deck() - shuffle(stacks[1]) - table.insert(locations,{1,2,2}) - -- Set up stacks - for i=1,7 do - stacks[i+6]=draw_cards(stacks[1], i) - table.insert(locations,{i+6,i*30,30}) - end end function TIC() @@ -159,7 +150,19 @@ aces of each suite. ]], 4, 78, 15) local mx,my,mleft,middle,mright,scrollx,scrolly=mouse() - if btnp(4) or btnp(5) or mleft then game_state='PLAY' end + if btnp(4) or btnp(5) or mleft then + game_state='PLAY' + + -- draw cards + stacks[1] = create_deck() + shuffle(stacks[1]) + table.insert(locations,{1,2,2}) + -- Set up stacks + for i=1,7 do + stacks[i+6]=draw_cards(stacks[1], i) + table.insert(locations,{i+6,i*30,30}) + end + end end function update()