mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
Fixing example and restoring SpriteComponent
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:flame/flame.dart';
|
||||
import 'package:flame/svg.dart';
|
||||
import 'package:flame/position.dart';
|
||||
import 'package:flame/components/component.dart' show SvgComponent;
|
||||
import 'package:flame/components/component.dart';
|
||||
import 'package:flame/components/mixins/resizable.dart';
|
||||
import 'package:flame/text_config.dart';
|
||||
|
||||
@ -16,12 +15,12 @@ void main() async {
|
||||
myGame.start();
|
||||
}
|
||||
|
||||
class AndroidComponent extends SvgComponent with Resizable {
|
||||
class AndroidComponent extends SpriteComponent with Resizable {
|
||||
static const int SPEED = 150;
|
||||
int xDirection = 1;
|
||||
int yDirection = 1;
|
||||
|
||||
AndroidComponent() : super.fromSvg(100, 100, Svg('android.svg'));
|
||||
AndroidComponent() : super.square(100, 'android.png');
|
||||
|
||||
@override
|
||||
void update(double dt) {
|
||||
|
||||
Reference in New Issue
Block a user