From f1a1730b7817ffcc2bf3b4f3c4b0feacfd5a218d Mon Sep 17 00:00:00 2001 From: Rb64 <91498309+Rb64@users.noreply.github.com> Date: Sun, 30 Jan 2022 20:58:22 +0100 Subject: [PATCH 1/4] Added Casual Mode toggle --- js/main.js | 2 +- style/style.css | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 5d8aae365..24d69c11c 100644 --- a/js/main.js +++ b/js/main.js @@ -362,7 +362,7 @@ function showHelp() { } } - $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); + $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


Casual Mode

By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); if (gameState == 1) { pause(); } diff --git a/style/style.css b/style/style.css index b57f23e85..1585fdaaa 100644 --- a/style/style.css +++ b/style/style.css @@ -99,6 +99,21 @@ button:focus { } +#casualSwitch:checked + #casualToggle { + background-color: aqua; + box-shadow: 0 0 6px rgba(0, 204, 255, 1); +} + +#casualSwitch{ + visibility: hidden; +} + +#casualToggle{ + font-size: 8px; + padding: 0px 12px; + border-radius: 5px; + background-color: #ccc; +} #pauseBtn { display:none; From 4ef2f2a05c7f5000b3ff3dc58ad629267c110248 Mon Sep 17 00:00:00 2001 From: Rb64 <91498309+Rb64@users.noreply.github.com> Date: Tue, 1 Feb 2022 19:08:32 +0100 Subject: [PATCH 2/4] added switchListner and added casualMode Setting --- js/initialization.js | 3 ++- js/input.js | 6 ++++++ js/main.js | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/js/initialization.js b/js/initialization.js index a22adf86f..0d39edbd3 100644 --- a/js/initialization.js +++ b/js/initialization.js @@ -66,7 +66,8 @@ function initialize(a) { speedModifier: 0.73, speedUpKeyHeld: false, creationSpeedModifier: 0.73, - comboTime: 310 + comboTime: 310, + casualMode: true }; } else { settings = { diff --git a/js/input.js b/js/input.js index 190f66f1c..a12bbf2c0 100644 --- a/js/input.js +++ b/js/input.js @@ -134,6 +134,12 @@ function addKeyListeners() { "#d35400": "rgb(210,180,222)" }; +/* $("#helpScreen").on('touchstart mousedown', function() { + console.log("CausalMode triggered!") + //settings.casualMode = document.getElementById("casualSwitch").checked + + }); + */ window.rgbToHex = { "rgb(142,68,173)": "#8e44ad", "rgb(241,196,15)": "#f1c40f", diff --git a/js/main.js b/js/main.js index 24d69c11c..96fd588c7 100644 --- a/js/main.js +++ b/js/main.js @@ -363,6 +363,10 @@ function showHelp() { } $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


Casual Mode

By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); + $("#casualToggle").on('touchstart mousedown', function() { + console.log("CausalMode triggered!") + }); + if (gameState == 1) { pause(); } From d83076599a1b4fad144823b4db2c6f93a3c7ad5d Mon Sep 17 00:00:00 2001 From: Rb64 <91498309+Rb64@users.noreply.github.com> Date: Thu, 3 Feb 2022 15:44:03 +0100 Subject: [PATCH 3/4] casualMode setting influence on blockdestroy handeling --- js/main.js | 3 ++- js/wavegen.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 96fd588c7..f4c69875f 100644 --- a/js/main.js +++ b/js/main.js @@ -364,7 +364,8 @@ function showHelp() { $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


Casual Mode

By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); $("#casualToggle").on('touchstart mousedown', function() { - console.log("CausalMode triggered!") + settings.casualMode = document.getElementById("casualSwitch").checked + console.log(settings.casualMode); }); if (gameState == 1) { diff --git a/js/wavegen.js b/js/wavegen.js index a4e85ff77..7c09a7b93 100644 --- a/js/wavegen.js +++ b/js/wavegen.js @@ -1,4 +1,9 @@ function blockDestroyed() { + if (settings.casualMode === undefined){ + settings.casualMode = false + } else if (settings.casualMode){ + return; + } if (waveone.nextGen > 1350) { waveone.nextGen -= 30 * settings.creationSpeedModifier; } else if (waveone.nextGen > 600) { From c9120f797317139446efd604b565be45d46aa153 Mon Sep 17 00:00:00 2001 From: Rb64 <91498309+Rb64@users.noreply.github.com> Date: Mon, 7 Feb 2022 12:11:37 +0100 Subject: [PATCH 4/4] first working casual Mode --- js/input.js | 6 ------ js/main.js | 5 ++--- js/wavegen.js | 8 +++++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/js/input.js b/js/input.js index a12bbf2c0..190f66f1c 100644 --- a/js/input.js +++ b/js/input.js @@ -134,12 +134,6 @@ function addKeyListeners() { "#d35400": "rgb(210,180,222)" }; -/* $("#helpScreen").on('touchstart mousedown', function() { - console.log("CausalMode triggered!") - //settings.casualMode = document.getElementById("casualSwitch").checked - - }); - */ window.rgbToHex = { "rgb(142,68,173)": "#8e44ad", "rgb(241,196,15)": "#f1c40f", diff --git a/js/main.js b/js/main.js index f4c69875f..c7329bd0b 100644 --- a/js/main.js +++ b/js/main.js @@ -362,10 +362,9 @@ function showHelp() { } } - $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


Casual Mode

By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); + $("#inst_main_body").html("
HOW TO PLAY

The goal of Hextris is to stop blocks from leaving the inside of the outer gray hexagon.

" + (settings.platform != 'mobile' ? 'Press the right and left arrow keys' : 'Tap the left and right sides of the screen') + " to rotate the Hexagon." + (settings.platform != 'mobile' ? ' Press the down arrow to speed up the block falling': '') + "

Clear blocks and get points by making 3 or more blocks of the same color touch.

Time left before your combo streak disappears is indicated by the colored lines on the outer hexagon


Casual Mode

By Logan Engstrom & Garrett Finucane
Find Hextris on iOS & Android
More @ the Hextris Website"); $("#casualToggle").on('touchstart mousedown', function() { - settings.casualMode = document.getElementById("casualSwitch").checked - console.log(settings.casualMode); + settings.casualMode = !document.getElementById("casualSwitch").checked }); if (gameState == 1) { diff --git a/js/wavegen.js b/js/wavegen.js index 7c09a7b93..63d774924 100644 --- a/js/wavegen.js +++ b/js/wavegen.js @@ -1,9 +1,11 @@ function blockDestroyed() { + var maxDifficulty = 35; if (settings.casualMode === undefined){ settings.casualMode = false } else if (settings.casualMode){ - return; + maxDifficulty = 8; } + if (waveone.nextGen > 1350) { waveone.nextGen -= 30 * settings.creationSpeedModifier; } else if (waveone.nextGen > 600) { @@ -12,10 +14,10 @@ function blockDestroyed() { waveone.nextGen = 600; } - if (waveone.difficulty < 35) { + if (waveone.difficulty < maxDifficulty) { waveone.difficulty += 0.085 * settings.speedModifier; } else { - waveone.difficulty = 35; + waveone.difficulty = maxDifficulty; } }