|
|
@ -78,7 +78,6 @@ class BonusWord extends Component with BlocComponent<GameBloc, GameState> {
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
Future<void> onLoad() async {
|
|
|
|
await super.onLoad();
|
|
|
|
await super.onLoad();
|
|
|
|
|
|
|
|
|
|
|
|
final letters = GameBloc.bonusWord.split('');
|
|
|
|
|
|
|
|
final positions = [
|
|
|
|
final positions = [
|
|
|
|
Vector2(-12.92, -1.82),
|
|
|
|
Vector2(-12.92, -1.82),
|
|
|
|
Vector2(-8.33, 0.65),
|
|
|
|
Vector2(-8.33, 0.65),
|
|
|
@ -95,7 +94,7 @@ class BonusWord extends Component with BlocComponent<GameBloc, GameState> {
|
|
|
|
unawaited(
|
|
|
|
unawaited(
|
|
|
|
add(
|
|
|
|
add(
|
|
|
|
BonusLetter(
|
|
|
|
BonusLetter(
|
|
|
|
letter: letters[i],
|
|
|
|
letter: GameBloc.bonusWord[i],
|
|
|
|
index: i,
|
|
|
|
index: i,
|
|
|
|
)..initialPosition = positions[i],
|
|
|
|
)..initialPosition = positions[i],
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -119,8 +118,8 @@ class BonusLetter extends BodyComponent<PinballGame>
|
|
|
|
paint = Paint()..color = _disableColor;
|
|
|
|
paint = Paint()..color = _disableColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// The area size of this [BonusLetter].
|
|
|
|
/// The size of the [BonusLetter].
|
|
|
|
static final areaSize = Vector2.all(3.7);
|
|
|
|
static final size = Vector2.all(3.7);
|
|
|
|
|
|
|
|
|
|
|
|
static const _activeColor = Colors.green;
|
|
|
|
static const _activeColor = Colors.green;
|
|
|
|
static const _disableColor = Colors.red;
|
|
|
|
static const _disableColor = Colors.red;
|
|
|
@ -152,7 +151,7 @@ class BonusLetter extends BodyComponent<PinballGame>
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Body createBody() {
|
|
|
|
Body createBody() {
|
|
|
|
final shape = CircleShape()..radius = areaSize.x / 2;
|
|
|
|
final shape = CircleShape()..radius = size.x / 2;
|
|
|
|
|
|
|
|
|
|
|
|
final fixtureDef = FixtureDef(shape)..isSensor = true;
|
|
|
|
final fixtureDef = FixtureDef(shape)..isSensor = true;
|
|
|
|
|
|
|
|
|
|
|
|