Skip to content

Commit 6d1025c

Browse files
Add files via upload
1 parent daba48a commit 6d1025c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
<body>
1414
<div id="footer">
1515
<a id="running-version">running v.<span id="version">1.2.3</span></a>
16-
<a href="/arthur/index.html" id="homepage" title="My home page, if you're interested in some other games." style="color:#fff;">Made by <u>Arthur Lumertz</u> | 4/26/23</a>
17-
<a href="/index.html" id="dtthnet" title="Back to our homepage." style="color:#fff;">DTTHNET</a>
16+
<a href="/arthur/index.html" id="homepage" title="My home page, if you're interested in some other games." style="color:#fff;">Made by <u>Arthur Lumertz</u> | 11/2/23</a>
1817
<a id="othergames" class="important" title="If you're interested in seeing how it's made." href="https://www.github.com/arthurlumertz/tree-simulator/" target="_blank">Source code</a>
1918
</div>
2019
<div id="game">
@@ -44,6 +43,7 @@
4443
<span class="menu" id="toggleNumbers" onclick="ToggleNumbers();">Numbers On</span>
4544
<!--<span class="menu" id="toggleFlashing" onclick="ToggleFlashing();">Flashing On</span>-->
4645
<span class="menu" id="toggleParticles" onclick="ToggleParticles();">Particles On</span>
46+
<span class="menu" id="toggleAudio" onclick="ToggleAudio();">Audio On</span>
4747
<br><br>
4848
<span id="treeClicked" style="display:none;">tree clicked : 0</span>
4949
</div>

main64.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function l(what) {return document.getElementById(what);}
22

33
Game=l('game');
4-
Version='1.2.5 pre-release (updating sept)';
4+
Version='1.2.5';
55
l('version').innerHTML=Version;
66
l('running-version').title='Running<br>Tree Simulator v.'+Version+'<br>Out: Apr, 27 2023';
77
console.log('== are you here to hack in trees? ==');
@@ -41,6 +41,7 @@ AchievementsToRebuild=0;
4141
NumbersOn=1;
4242
FlashingOn=1;
4343
ParticlesOn=1;
44+
AudioOn=1;
4445

4546
T=0;
4647
Loaded=0;
@@ -62,6 +63,11 @@ ToggleParticles=function() {
6263
else if(!ParticlesOn) {ParticlesOn=1;l('toggleParticles').innerHTML='Particles On';}
6364
}
6465

66+
ToggleAudio=function() {
67+
if(AudioOn) {AudioOn=0;l('toggleAudio').innerHTML='Audio Off';}
68+
else if(!AudioOn) {AudioOn=1;l('toggleAudio').innerHTML='Audio On';}
69+
}
70+
6571
importSave=function() {
6672
var save=prompt('Please paste in the text that was given to you on save export.','');
6773
if(save && save!='') ImportResponse('1|'+save);
@@ -181,7 +187,7 @@ ClickTree=function() {
181187
TreesClicked++;
182188
if(treeClick) treeClick.remove();
183189
treeClick=new Audio('snd/click1.wav');
184-
treeClick.play();
190+
if (AudioOn) treeClick.play();
185191
if (Pops.length<260 && NumbersOn) new Pop('bigTree','+'+CpS);
186192
}
187193

@@ -232,7 +238,7 @@ Buyable=function(name,desc,pic,price,tps,func) {
232238
this.func(1);
233239
StoreToRebuild=1;
234240

235-
buyClick.play();
241+
if (AudioOn) buyClick.play();
236242

237243
TpS+=this.tps;
238244
}
@@ -440,6 +446,8 @@ l('dtthnet').addEventListener('mouseenter', showTooltip);
440446
l('running-version').addEventListener('mouseenter', showTooltip);
441447

442448
function showTooltip(event) {
449+
event.preventDefault();
450+
443451
const tooltip = document.createElement('div');
444452
tooltip.classList.add('tooltip');
445453
tooltip.id='tooltip';

0 commit comments

Comments
 (0)