59 lines
957 B
Dart
59 lines
957 B
Dart
// 渲染层只读的"视图"接口:让 sprites.dart 不依赖完整游戏类,避免循环依赖。
|
|
import 'dart:ui' show Color;
|
|
|
|
abstract class PlayerView {
|
|
double get x;
|
|
double get y;
|
|
double get w;
|
|
double get h;
|
|
double get cx;
|
|
double get cy;
|
|
bool get grounded;
|
|
int get facing;
|
|
bool get hasGun;
|
|
bool get dead;
|
|
}
|
|
|
|
abstract class EntityView {
|
|
double get x;
|
|
double get y;
|
|
double get w;
|
|
double get h;
|
|
bool get active;
|
|
bool get falling;
|
|
String get dir;
|
|
}
|
|
|
|
abstract class MoverView {
|
|
double get x;
|
|
double get y;
|
|
double get w;
|
|
double get h;
|
|
double get ax;
|
|
double get ay;
|
|
double get aw;
|
|
double get ah;
|
|
double get bx;
|
|
double get by;
|
|
}
|
|
|
|
abstract class BulletView {
|
|
double get x;
|
|
double get y;
|
|
double get w;
|
|
double get h;
|
|
String get col;
|
|
bool get big;
|
|
}
|
|
|
|
class DeathFX {
|
|
double x, y;
|
|
int t;
|
|
DeathFX(this.x, this.y, this.t);
|
|
}
|
|
|
|
class DeathMark {
|
|
double x, y;
|
|
DeathMark(this.x, this.y);
|
|
}
|