mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
Add trailing commas
This commit is contained in:
@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flame/flame.dart';
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:infinite_effects/square.dart';
|
||||
import './square.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@ -37,13 +37,15 @@ class MyGame extends BaseGame with TapDetector {
|
||||
speed: 250.0,
|
||||
curve: Curves.bounceInOut,
|
||||
isInfinite: true,
|
||||
isAlternating: true));
|
||||
isAlternating: true,
|
||||
));
|
||||
redSquare.clearEffects();
|
||||
redSquare.addEffect(ScaleEffect(
|
||||
size: Size(dx, dy),
|
||||
speed: 250.0,
|
||||
curve: Curves.easeInCubic,
|
||||
isInfinite: true,
|
||||
isAlternating: true));
|
||||
isAlternating: true,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:flame/anchor.dart';
|
||||
import 'package:flame/components/component.dart';
|
||||
|
||||
import 'dart:ui';
|
||||
@ -10,6 +11,7 @@ class Square extends PositionComponent {
|
||||
height = 100;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
anchor = Anchor.center;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -22,13 +22,13 @@ class MoveEffect extends PositionComponentEffect {
|
||||
double _yDistance;
|
||||
double _yDirection;
|
||||
|
||||
MoveEffect(
|
||||
{@required this.destination,
|
||||
@required this.speed,
|
||||
this.curve,
|
||||
isInfinite = false,
|
||||
isAlternating = false})
|
||||
: super(isInfinite, isAlternating);
|
||||
MoveEffect({
|
||||
@required this.destination,
|
||||
@required this.speed,
|
||||
this.curve,
|
||||
isInfinite = false,
|
||||
isAlternating = false,
|
||||
}) : super(isInfinite, isAlternating);
|
||||
|
||||
@override
|
||||
set component(_comp) {
|
||||
|
||||
@ -19,13 +19,13 @@ class ScaleEffect extends PositionComponentEffect {
|
||||
Size _diff;
|
||||
final Position _dir = Position.empty();
|
||||
|
||||
ScaleEffect(
|
||||
{@required this.size,
|
||||
@required this.speed,
|
||||
this.curve,
|
||||
isInfinite = false,
|
||||
isAlternating = false})
|
||||
: super(isInfinite, isAlternating);
|
||||
ScaleEffect({
|
||||
@required this.size,
|
||||
@required this.speed,
|
||||
this.curve,
|
||||
isInfinite = false,
|
||||
isAlternating = false,
|
||||
}) : super(isInfinite, isAlternating);
|
||||
|
||||
@override
|
||||
set component(_comp) {
|
||||
|
||||
Reference in New Issue
Block a user