bruh
This commit is contained in:
parent
db7981024f
commit
361d4cca54
3 changed files with 5 additions and 1 deletions
|
@ -50,7 +50,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class = "col navbar navbar-fixed-bottom vh-75 min-vh-50 text-break ml-5" id = "bodydiv" style = "min-height: 75vh; display: flex; flex-direction: column;" >
|
<div class = "col navbar navbar-fixed-bottom vh-75 min-vh-50 text-break ml-5" id = "bodydiv" style = "min-height: 75vh; display: flex; flex-direction: column;" >
|
||||||
</div>
|
</div>
|
||||||
|
<audio id="bruh_sound_effect" src="../media/audio/bruh_sound_effect.mp3" preload="auto"></audio>
|
||||||
</div>
|
</div>
|
||||||
<!-- sidebar -->
|
<!-- sidebar -->
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,10 @@ function runAtlas() {
|
||||||
let center = [(at1[0]+at2[0])/2, (at1[1]+at2[1])/2 ];
|
let center = [(at1[0]+at2[0])/2, (at1[1]+at2[1])/2 ];
|
||||||
|
|
||||||
if (Math.sqrt(((at2[1]+atlas2.vy) - (at1[1]+atlas1.vy))**2 + ((at2[0]+atlas2.vx) - (at1[0]+atlas1.vx))**2) < 2*r) {
|
if (Math.sqrt(((at2[1]+atlas2.vy) - (at1[1]+atlas1.vy))**2 + ((at2[0]+atlas2.vx) - (at1[0]+atlas1.vx))**2) < 2*r) {
|
||||||
|
//Play bruh sound effect
|
||||||
|
document.getElementById('bruh_sound_effect').play();
|
||||||
|
document.getElementById('bruh_sound_effect').currentTime = 0;
|
||||||
|
|
||||||
if(Math.sqrt( (at2[1]-at1[1])**2 + (at2[0]-at1[0])**2 ) < 2*r ) {//check for collision
|
if(Math.sqrt( (at2[1]-at1[1])**2 + (at2[0]-at1[0])**2 ) < 2*r ) {//check for collision
|
||||||
//Move both away slightly - correct alg this time :)
|
//Move both away slightly - correct alg this time :)
|
||||||
atlas1.style.left = parseFloat(atlas1.style.left.replace("px","")) + (at1[0]-center[0]) * 2 * r / Math.sqrt(dx**2 + dy**2) + "px";
|
atlas1.style.left = parseFloat(atlas1.style.left.replace("px","")) + (at1[0]-center[0]) * 2 * r / Math.sqrt(dx**2 + dy**2) + "px";
|
||||||
|
|
BIN
media/audio/bruh_sound_effect.mp3
Normal file
BIN
media/audio/bruh_sound_effect.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue