diff --git a/pages/robotGameArea.js b/pages/robotGameArea.js
index 478ef9ff5ec0a717b2ac570318bdd6d267854d4e..6cdcd250025f5e3aefac7c86cf85f8794d745c77 100644
--- a/pages/robotGameArea.js
+++ b/pages/robotGameArea.js
@@ -1,3 +1,7 @@
+// Zorluk Dereceleri:
+// 1: Easy
+// 2: Medium
+// 3: Hard
const zorlukDerecesi = 2;
class Hole {
@@ -14,11 +18,12 @@ class Hole {
}
}
+var robotMedium = 0;
async function wait(x) {
setTimeout(() => {
console.log("Done waiting");
- if(zorlukDerecesi == 1){
+ if(zorlukDerecesi == 1 || zorlukDerecesi == 2){
robotEasy();
}
@@ -66,21 +71,23 @@ function tikla(id){
dagit(Number(id[4]),Number(id[9]));
boncukCiz();
- if(zorlukDerecesi == 2){
+ if(zorlukDerecesi == 3){
while(player == 1){
- robotMedium();
+ robotHard();
}
+ }else if(zorlukDerecesi == 2 && robotMedium % 3 == 1 ){
+ robotMedium +=1;
+ while(player == 1){
+ robotHard();
+ }
+
}else{
+ robotMedium +=1;
if( player == 1){
wait(2000);
}
}
-
-
-
-
-
-
+
}
}
@@ -294,6 +301,7 @@ function boncukCiz(){
function robotEasy(){
// player 1 i kontrol eden robot
+ console.log("EEEEasy calisti.");
let array = doluHoleler();
let len = array.length;
if(len > 0){
@@ -301,8 +309,8 @@ function robotEasy(){
tikla("user1hole"+(array[holeID]+1).toString()+"x");
}
}
-
-function robotMedium(){
+function robotHard(){
+ console.log("HHHHARD calisti.");
let array = doluHoleler();
let len = array.length;
let score_ar = []; // dolu hucrelerle ayni indisle
@@ -318,7 +326,7 @@ function robotMedium(){
console.log("ilk bosalt sonrasi user2hole uzunnlugu: ",user2hole.length);
/*
- console.log("robotMedium hesaplama basliyor..");
+ console.log("robotHard hesaplama basliyor..");
console.log("temp1[0].value: ", temp1[0].value);
console.log("user1hole[0].value: ", user1hole[0].value);
console.log("atamar yapiliyor..");
@@ -412,4 +420,15 @@ function drop(ev) {
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
counterDown();
-}
\ No newline at end of file
+}
+
+
+//overlay ac kapa
+function overlay() {
+ document.getElementById("overlay").style.display = "block";
+ }
+
+function overlayOff() {
+ document.getElementById("overlay").style.display = "none";
+}
+
\ No newline at end of file