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

Hard seviye eklendi.

Yeni zorluk seviyesi Hard eklendi.
üst 23dba29f
......@@ -10,6 +10,9 @@
<body>
<div class="container">
<div id="overlay" onclick="overlayOff()">
<div id="text">Bitti</div>
</div>
<div id="user1hole7" class="rectangle">hazine</div>
<div class="circle_container">
<div class="circle_wrap">
......
// 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
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