Merge branch 'v1.0.0' into erick.assets-refactor-2

This commit is contained in:
Erick Zanardo
2020-09-29 23:54:11 -03:00
125 changed files with 1213 additions and 820 deletions

View File

@ -1,6 +1,6 @@
import 'package:flame/game.dart';
import 'package:flame/flame.dart';
import 'package:flame/position.dart';
import 'package:flame/extensions/vector2.dart';
import 'package:flame/components/sprite_component.dart';
import 'package:flame/components/mixins/resizable.dart';
import 'package:flame/text_config.dart';
@ -36,14 +36,14 @@ class AndroidComponent extends SpriteComponent with Resizable {
final rect = toRect();
if ((x <= 0 && xDirection == -1) ||
(rect.right >= size.width && xDirection == 1)) {
(rect.right >= size.x && xDirection == 1)) {
xDirection = xDirection * -1;
}
y += yDirection * SPEED * dt;
if ((y <= 0 && yDirection == -1) ||
(rect.bottom >= size.height && yDirection == 1)) {
(rect.bottom >= size.y && yDirection == 1)) {
yDirection = yDirection * -1;
}
}
@ -86,7 +86,7 @@ class MyGame extends BaseGame {
super.render(canvas);
if (debugMode()) {
fpsTextConfig.render(canvas, fps(120).toString(), Position(0, 50));
fpsTextConfig.render(canvas, fps(120).toString(), Vector2(0, 50));
}
}
}