java - Libgdx: Scoring points basic -
i trying code score system increments whenever collision occurs between enemy , player. initialize score 100 , incremented once collision detected, means the old score 100 , new 1 101. happen old score 0 while new score 100. can me debut code. thank you.
here code:
when call getscore() first time, hasn't been initialized yet, returns 0.
what scoreincrement() method add 100 tempscore, added score (which 100).
if understood intentions correctly, use this:
//initialize score 100 private int score = 100; //method incrementing score 1 public void scoreincrement() { score++; } //score getter public int getscore() { return score; }
Hello admin,
ReplyDeleteI attempting code score framework increases at whatever point impact happens between foe, player. instate score 100, increased once impact identified, implies the old score 100, new 1 101.
Regards,
Thanks
RITU
Hello admin,
ReplyDeleteI attempting code score framework increases at whatever point effect occurs between foe, participant. Instate score a hundred, expanded once effect recognized, implies the antique score 100, new 1 101.
Regards,
Thankskomal