Kaydet (Commit) 094b5458 authored tarafından Muaz's avatar Muaz

Hard seviye eklendi.

Yeni zorluk seviyesi Hard eklendi.
üst 23dba29f
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<body> <body>
<div class="container"> <div class="container">
<div id="overlay" onclick="overlayOff()">
<div id="text">Bitti</div>
</div>
<div id="user1hole7" class="rectangle">hazine</div> <div id="user1hole7" class="rectangle">hazine</div>
<div class="circle_container"> <div class="circle_container">
<div class="circle_wrap"> <div class="circle_wrap">
......
// Zorluk Dereceleri:
// 1: Easy
// 2: Medium
// 3: Hard
const zorlukDerecesi = 2; const zorlukDerecesi = 2;
class Hole { class Hole {
...@@ -14,11 +18,12 @@ class Hole { ...@@ -14,11 +18,12 @@ class Hole {
} }
} }
var robotMedium = 0;
async function wait(x) { async function wait(x) {
setTimeout(() => { setTimeout(() => {
console.log("Done waiting"); console.log("Done waiting");
if(zorlukDerecesi == 1){ if(zorlukDerecesi == 1 || zorlukDerecesi == 2){
robotEasy(); robotEasy();
} }
...@@ -66,21 +71,23 @@ function tikla(id){ ...@@ -66,21 +71,23 @@ function tikla(id){
dagit(Number(id[4]),Number(id[9])); dagit(Number(id[4]),Number(id[9]));
boncukCiz(); boncukCiz();
if(zorlukDerecesi == 2){ if(zorlukDerecesi == 3){
while(player == 1){ while(player == 1){
robotMedium(); robotHard();
} }
}else if(zorlukDerecesi == 2 && robotMedium % 3 == 1 ){
robotMedium +=1;
while(player == 1){
robotHard();
}
}else{ }else{
robotMedium +=1;
if( player == 1){ if( player == 1){
wait(2000); wait(2000);
} }
} }
} }
} }
...@@ -294,6 +301,7 @@ function boncukCiz(){ ...@@ -294,6 +301,7 @@ function boncukCiz(){
function robotEasy(){ function robotEasy(){
// player 1 i kontrol eden robot // player 1 i kontrol eden robot
console.log("EEEEasy calisti.");
let array = doluHoleler(); let array = doluHoleler();
let len = array.length; let len = array.length;
if(len > 0){ if(len > 0){
...@@ -301,8 +309,8 @@ function robotEasy(){ ...@@ -301,8 +309,8 @@ function robotEasy(){
tikla("user1hole"+(array[holeID]+1).toString()+"x"); tikla("user1hole"+(array[holeID]+1).toString()+"x");
} }
} }
function robotHard(){
function robotMedium(){ console.log("HHHHARD calisti.");
let array = doluHoleler(); let array = doluHoleler();
let len = array.length; let len = array.length;
let score_ar = []; // dolu hucrelerle ayni indisle let score_ar = []; // dolu hucrelerle ayni indisle
...@@ -318,7 +326,7 @@ function robotMedium(){ ...@@ -318,7 +326,7 @@ function robotMedium(){
console.log("ilk bosalt sonrasi user2hole uzunnlugu: ",user2hole.length); 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("temp1[0].value: ", temp1[0].value);
console.log("user1hole[0].value: ", user1hole[0].value); console.log("user1hole[0].value: ", user1hole[0].value);
console.log("atamar yapiliyor.."); console.log("atamar yapiliyor..");
...@@ -412,4 +420,15 @@ function drop(ev) { ...@@ -412,4 +420,15 @@ function drop(ev) {
var data = ev.dataTransfer.getData("text"); var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data)); ev.target.appendChild(document.getElementById(data));
counterDown(); 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment