Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added audio/womp_womp.mp3
Binary file not shown.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ <h3>Move using:</h3>
<div class="mobile-message" hidden>
<h2>Please use application on larger screen!</h2>
</div>
<script src="./main.js"></script>
<script src="./main.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const score = document.querySelector('.score'),
modalContentText = document.querySelector('.modal-content__text'),
modalClose = document.getElementById('close-modal');

const music = new Audio('audio/bensound-happyrock.mp3');
const music = new Audio('audio/bensound-happyrock.mp3');
const wompSound = new Audio("audio/womp_womp.mp3");

car.classList.add('car');

Expand Down Expand Up @@ -180,6 +181,7 @@ function moveEnemy() {
carRect.bottom >= enemyRect.top) {
setting.start = false;
start.classList.remove('hide');
wompSound.play();
}
enemy.y += setting.speed / 2;
enemy.style.top = enemy.y + 'px';
Expand Down
Loading