.
. .
.
.
(
*
)
.
.
(
*) .
.
.
.
.
.
.
.
.
.
.
(
*
)
.
.
.
.
.
.
(
*
)
.
. . .
. .(* ) . (* ) .(* ) .(* ) . . . . . . . . . . . . . . . . . .(* ) . . . . . . . . . . . . . . . .(* )Asked(* ) . (* )today . . Checked Out . 10 times .
I have a really little clicking video game.
In the video game, there is an employee matter,
yet you can just hire an employee when you
have actually accumulated 10 or even more food.
I make sure that you all know with this principle.
Nevertheless, the” if” declaration determining if you can buy an employee isn’t functioning, regardless of what I attempt.
My phrase structure is– to my understanding– simply penalty, therefore is the format.
Is something else failing?
all set( feature () {
woodCount= 0; stoneCount= 0; foodCount =0; populace = 0; woodAdd= 1
;
stoneAdd= 1; foodAdd= 1; populationAdd= 1; woodWorkers = 0; stoneWorkers= 0;
foodWorkers =0;
jobless= 0;$(“. wood-gather”).
click( feature() {
woodCount= woodCount+ woodAdd;}
);$(“. stone-gather”).
click( feature() {
stoneCount = stoneCount + stoneAdd;}
);$(“.
food-gather”).
click( feature() {foodCount= foodCount+ foodAdd;}
); if( foodCount >= 10) {
$(“. worker-recruit”). click( feature() {populace = populace + 1; jobless= jobless+ 1;
foodCount= foodCount- 10; console.log( populace); console.log(>foodCount); console.log (
eliminate();
$(” #FlabelDiv”).
append(” < tag for =" foodGather" id=' FCount' > Food: “+ foodCount+” ” );
$(” #UEM”).
eliminate();$(” #unemployedWrap”).
append(” < p id=
' UEM' > Unemployed:”+ jobless+” “);
}
var period= self.setInterval (feature() {CountAppend().}, 10);<})
<;
<100px; margin-left: 10px;}. food-gather {placement: outright; top: 65px; left: 84px;
<}
<. #FlabelDiv {
<. placement: loved one; top: 2px; margin-left: 10px;}
< manuscript src=">http://code.jquery.com/jquery-1.10.2.min.js”
<> < div>course=” workerWrap” > < div>id<=" workerRecruitWrap">
<> < div id=" PlabelDiv">
<> < tag for=><" workerRecruit" > Employees<: < switch course=" worker-recruit">worth=” Employees” name=” workerRecruit” > Employee .
< div id=" jobWrap" > < div id=" unemployedWrap" design="
placement: outright; top: 120px; margin-left: 10px;" >. . .
. < div course=" foodWrap" > < div id=" foodGatherWrap" > < div id= "FlabelDiv" > < switch course=" food-gather" worth=" Food" name=" foodGather" > Gather .
.
asked 5 minutes back
.
WebVar
.
11 6(*
) 6 bronze badges
.
3
Repaired code.
$( paper).
all set( feature() {
woodCount = 0;
stoneCount= 0; foodCount= 0; populace =0; woodAdd
= 1; stoneAdd = 1;
foodAdd= 1;
populationAdd= 1; woodWorkers= 0; stoneWorkers= 0; foodWorkers= 0; jobless= 0;$(".
wood-gather"). click( feature() {
woodCount= woodCount+ woodAdd;});$(".
stone-gather"). click( feature() {
stoneCount =stoneCount+ stoneAdd;}
);$(". food-gather").
click( feature() {
foodCount = foodCount + foodAdd;
} );
if( foodCount >= 10)
{
$(".
worker-recruit" ).
click( feature() {
populace= populace+ 1; jobless= jobless+ 1; foodCount= foodCount - 10;
console.log( populace); console.log( foodCount); console.log( jobless );});}
// THIS IS THE TROUBLE CODE ^. feature CountAppend()<{$(" #WCount "). eliminate()>;$(" #WlabelDiv "<).
append(" < tag for="> Timber:" + woodCount + "<");
$(" #SCount"). eliminate();
$(" #SlabelDiv"). append("<< tag for="stoneGather" id='>SCount' > Rock:" + stoneCount + "<");
$(" #FCount").
eliminate(); $ (" #FlabelDiv"). append(" < tag for =" foodGather" id='FCount' > Food:" + foodCount +" "); $(" #UEM").
eliminate();
$(" #unemployedWrap").
append(" < p
id='UEM' > Unemployed:"
+ jobless +" ");} var period = self.setInterval( feature() {CountAppend().
}, 10);});
.
.