Bug 627

Summary: In Player Mode, the snake's score does not increase after eating beans
Product: CS3343 2021/22 Group16 Greedy Snake Reporter: LI Ruoxin <ruoxinli3-c>
Component: Model sectionAssignee: Baron Qu <zhiyanqu2-c>
Status: RESOLVED FIXED    
Severity: critical CC: ruoxinli3-c
Priority: ---    
Version: Ver 3.0   
Hardware: PC   
OS: Windows   

Description LI Ruoxin 2021-11-29 17:07:30 HKT
Steps to Reproduce:
1. Run Main.java
2. Press Key 1 to select Player Mode
3. Operate the snake to eat beans

Actual Results: The snake's score is not increased after eating beans

Expected Results: The snake's score should be increased by one after eating normal beans and by three after eating score beans
Comment 1 Baron Qu 2021-12-05 11:33:36 HKT
After checking the code, the reason is in the background.java, the score just gets from the AISnake.getInstance().getScore(). Hence, we remove the score description from the background.java to snake.java, then every snake would set its own score.