Bug 628 - The score bean only appears once
Summary: The score bean only appears once
Status: RESOLVED FIXED
Alias: None
Product: CS3343 2021/22 Group16 Greedy Snake
Classification: Unclassified
Component: Model section (show other bugs)
Version: Ver 2.0
Hardware: PC Windows
: --- major
Assignee: Baron Qu
URL:
Depends on:
Blocks:
 
Reported: 2021-11-29 18:53 HKT by LI Ruoxin
Modified: 2021-11-29 19:01 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 18:53:08 HKT
Steps to reproduce:
1. Run Main.java
2. Press any Arrow Key to start the game

Actual Results: The score bean only appears once

Expected Results: The score bean should appear each time after a fixed number of normal beans have appeared.
Comment 1 LI Ruoxin 2021-11-29 19:01:51 HKT
Game.java
Modified an if statement ( missing an & sign before):
if (time >= SConstant.SC_SCORE_BEAN_DEFAULT_APPEAR_TIME && snake.getScore() > prevScore) {
				bean = ScoreBean.getInstance();
				countTime = SConstant.SC_SCORE_BEAN_DEFAULT_DISAPPEAR_TIME;
			}