瀏覽代碼

Update GeneticAlgorithm_BoardWarSimulation.c

Rudy Boudewijn van Etten 4 年之前
父節點
當前提交
6e96fd43e1
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      ai/GeneticAlgorithm_BoardWarSimulation.c

+ 7 - 2
ai/GeneticAlgorithm_BoardWarSimulation.c

@@ -26,6 +26,9 @@
 // Building on this you might change the amount of units for each side. maybe mod the amount of goals to be captured.
 // In a real game you might use this to simulate if a war for a ai player would be doable in a certain tested setting like this.
 //
+// Create unit types with different att and def, more scoring with 1+units attacking at the same time.
+
+
 
 #include "raylib.h"
 #include <math.h>
@@ -94,7 +97,7 @@ int main(void)
     
     InitWindow(screenWidth, screenHeight, "raylib example.");
  
-    SetTargetFPS(60);               // Set our game to run at 60 frames-per-second
+    SetTargetFPS(120);               // Set our game to run at 60 frames-per-second
     //--------------------------------------------------------------------------------------
 
     geneticalgorithm();
@@ -107,7 +110,7 @@ int main(void)
         // Update
         //----------------------------------------------------------------------------------
         
-        if(IsKeyPressed(KEY_SPACE)){
+        if(IsKeyPressed(KEY_SPACE)|| playposition>MAX_CODE-2){
             geneticalgorithm();
             playposition=0;
         }
@@ -176,6 +179,7 @@ int main(void)
             }
             }
             DrawText("Press space for new simulation.",10,10,20,BLACK);
+            /*
             int c=0;
             for(int y=0;y<40;y++){
             for(int x=0;x<5;x++){
@@ -184,6 +188,7 @@ int main(void)
                 }
                 c++;
             }}
+            */
 
         EndDrawing();
         //----------------------------------------------------------------------------------