Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Separation behavior #40

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sandbox/lib/presets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class Presets {
_flee1(),
_flee2(),
]),
_PresetGroup('Seperate', [
st-pasha marked this conversation as resolved.
Show resolved Hide resolved
_sepe1(),
])
];

static int get numGroups => _presets.length;
Expand Down Expand Up @@ -97,6 +100,28 @@ class Presets {
return p;
}

static Scene _sepe1() {
st-pasha marked this conversation as resolved.
Show resolved Hide resolved
final p = Scene('Seperate');
final target = StaticEntity(position: Vector2(0, 0));
final escapee = HeavyEntity(
position: Vector2(-20, 0),
velocity: Vector2(15, 0),
maxSpeed: 20,
maxAcceleration: 10,
);
final escapee2 = HeavyEntity(
position: Vector2(20, 0),
velocity: Vector2(-15, 0),
maxSpeed: 20,
maxAcceleration: 10,
);
escapee.behavior = Flee(owner: escapee, targets: [target.position]);
escapee2.behavior = Flee(owner: escapee2, targets: [target.position]);
p.add(escapee);
p.add(escapee2);
return p;
}

//# endregion
}

Expand Down