call random every frame so retroarch TIC-80 doesnt start at the same game every time

main
LeRoyce Pearson 2024-03-07 21:01:22 -07:00
parent 6f96d801e0
commit 4555a95357
1 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,8 @@ end
function shuffle(cards) function shuffle(cards)
for a,c in ipairs(cards) do for a,c in ipairs(cards) do
local b=math.random(#cards) if a == #cards then break end
local b=a + math.random(#cards - a)
local tmp=cards[a] local tmp=cards[a]
cards[a]=cards[b] cards[a]=cards[b]
cards[b]=tmp cards[b]=tmp
@ -122,6 +123,7 @@ function BOOT()
end end
function TIC() function TIC()
math.random(52)
if btnp(6) then reset() end if btnp(6) then reset() end
if game_state=='MENU' then if game_state=='MENU' then
update_menu(); update_menu();