Browse Source

Shuffle levels when restarting a game

DricomDragon 5 năm trước cách đây
mục cha
commit
f484b6761c
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      Game.gd

+ 1 - 0
Game.gd

@@ -55,6 +55,7 @@ func create_game():
 
 		if (levelIndex >= levelScenes.size()):
 			levelIndex = 0
+			levelScenes.shuffle()
 
 		if !levelScenes[levelIndex]:
 			levelScenes[levelIndex] = load_level(levelNames[levelIndex])