Skip to content

Commit

Permalink
shows remaining kills
Browse files Browse the repository at this point in the history
  • Loading branch information
blueSparrow2000 committed Jul 3, 2024
1 parent 85aa6fb commit 05cb401
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
Binary file modified BLACKOUT WIKI.xlsx
Binary file not shown.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,17 @@ https://www.youtube.com/watch?v=wLojAqzOkSk
2024.7.2 Now you can scroll to change inventory! / Minimap key is changed to 'Q' / Press 'E' to dash towards a mouse direction. Dash is recharged when you get a kill, charging upto one.


2024.7.3 Shows remaining kills



Future plan:
- Melee update: frisby / sakura (jett skill)
- vehicle-vehicle collision
- Military base: finish structures / add trees (object) in the dense forest
- smarter AI (zombies shoots projectiles)

- SONA (shows location of enemy in the map & direction for 1 seconds)
- smarter AI (zombies shoots projectiles)
- wind update
- make melee weapon skin (katana etc.) + more powerful melee weapons!

Expand Down
21 changes: 17 additions & 4 deletions public/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,17 @@ function showKillLog(loglist){

}

function showkillRemain(num){
document.querySelector(`#killsRemaining`).innerHTML = `<div data-id="0"> ${num} </div>`
}

function calc_kill_remain(score){ // remaining kills = number of guns (in the gunOrderInDeathmatch) - score
return 15 - score
}


function updateItemHTML(itemIDX,itemName){
document.querySelector(`#item${itemIDX}`).innerHTML = `<div data-id="${itemIDX}"> [${itemIDX}] ${itemName} </div>`

}

function updateLastWinner(name){
Expand Down Expand Up @@ -1107,6 +1115,9 @@ socket.on('updateFrontEnd',({backEndPlayers, backEndEnemies, backEndProjectiles,
const prevItemID = frontEndPlayerOthers.inventory[i]
if (prevItemID !== backEndItem.myID){ // my inventory change by server's decision (like gun update due to score/placing/consume)
updateItemHTML(i+1,frontEndItems[backEndItem.myID].name)
if (i===0){ // for current gun
showkillRemain(calc_kill_remain(frontEndPlayerOthers.score))
}
}
}

Expand All @@ -1131,7 +1142,7 @@ socket.on('updateFrontEnd',({backEndPlayers, backEndEnemies, backEndProjectiles,
if (!backEndPlayers[id]){
const divToDelete = document.querySelector(`div[data-id="${id}"]`)
divToDelete.parentNode.removeChild(divToDelete)

// if I dont exist
if (id === myPlayerID) { // reshow the start button interface
const mePlayer = frontEndPlayers[myPlayerID]
Expand All @@ -1140,7 +1151,9 @@ socket.on('updateFrontEnd',({backEndPlayers, backEndEnemies, backEndProjectiles,
playerdeathsound.play()
document.querySelector('#usernameForm').style.display = 'block'
hideInventory()

// reset kill remains
showkillRemain(0)

//socket.emit('playerdeath',{playerId: id, armorID: mePlayer.wearingarmorID, scopeID: mePlayer.wearingscopeID,vehicleID:mePlayer.ridingVehicleID})
if (winnerCeremony){
// LobbyBGM.volume = 1
Expand Down Expand Up @@ -2096,7 +2109,7 @@ document.querySelector('#usernameForm').addEventListener('submit', (event) => {
updateItemHTML(i+1,'fist')
}
showInventory()

showkillRemain(15)
// reset particle ids
particleID = 0
})
Expand Down
18 changes: 17 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@
</div>
</div>

<div
style="
position: absolute;
color: white;
padding: 8px;
left: 50%;
transform: translateX(-50%);
text-align: center;
font-family: sans-serif;
font-size: 16px;
user-select: none;
background: rgb(43, 40, 40)"
>
<span style="margin-bottom: 8px;white-space:pre;"> Kills Remaining </span>
<div style="font-size: 32px;" id="killsRemaining">
</div>
</div>

<div
style="
Expand Down Expand Up @@ -167,7 +184,6 @@ <h1 class="text-4xl font-bold mb-0" style="padding: 0px 10px 0px 10px;" id="poin
Reload gun (except flaregun/airdrops): R <br>
Interact (pick up/drive): F <br>
See minimap: Q <br>
Show gun range: V <br>
Dash: E <br>
</p>
</div>
Expand Down

0 comments on commit 05cb401

Please sign in to comment.