Bug 627 - In Player Mode, the snake's score does not increase after eating beans
Summary: In Player Mode, the snake's score does not increase after eating beans
Status: RESOLVED FIXED
Alias: None
Product: CS3343 2021/22 Group16 Greedy Snake
Classification: Unclassified
Component: Model section (show other bugs)
Version: Ver 3.0
Hardware: PC Windows
: --- critical
Assignee: Baron Qu
URL:
Depends on:
Blocks:
 
Reported: 2021-11-29 17:07 HKT by LI Ruoxin
Modified: 2021-12-05 11:33 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.