naprawa malego bledu
This commit is contained in:
parent
bdafb95511
commit
070794daf2
@ -19,6 +19,7 @@ const Hero = () => {
|
||||
let number_of_defenders = 0;
|
||||
let number_of_strikers = 0;
|
||||
let number_of_goalkeepers = 0;
|
||||
let numer_od_shooters = 0;
|
||||
var eX = " ";
|
||||
|
||||
|
||||
@ -178,14 +179,6 @@ const Hero = () => {
|
||||
}
|
||||
function whileMove(ball){
|
||||
|
||||
var ev = document.getElementById('footballField')
|
||||
var bojo = document.getElementById('footballField')
|
||||
var bnd = ev.target.getBoundingClientRect()
|
||||
var x = ((ev.clientX - bnd.left)/bojo.offsetWidth)*100;
|
||||
var y = ((ev.clientY - bnd.top)/bojo.offsetHeight)*100;
|
||||
|
||||
ball.style.left = x + "%"
|
||||
ball.style.top = y + "%"
|
||||
}
|
||||
|
||||
// Wysłanie zapytania do serwera
|
||||
@ -224,11 +217,11 @@ const Hero = () => {
|
||||
|
||||
//dodanie zawodnika do listy oraz punktu do mapy w zaleznosci od aktywnosci przycisku 1,2,3 lub 4
|
||||
if(active_bbt=="bbt1"){
|
||||
let existingBall = document.querySelector('.football');
|
||||
if(!existingBall){
|
||||
if(numer_od_shooters < 1 ){
|
||||
addPlayer(0,ball)
|
||||
bojo.appendChild(ball)
|
||||
ball.style.background = "#fc0303"
|
||||
umer_od_shooters = numer_od_shooters + 1
|
||||
}else{alert("mozesz dodac tylko jednego strzelca")}
|
||||
}else if(active_bbt == "bbt2"){
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user