Skip to content

Commit

Permalink
invert positions
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticalNobody committed Oct 30, 2021
1 parent 8267708 commit 36cb273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/component/youngster_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ class YoungsterComponent extends SpriteBodyComponent with Draggable {
void update(double dt) {
super.update(dt);
if (throwingTrajectory != null && dragging) {
throwingTrajectory!.showDrag(body.position, dragDiff!);
throwingTrajectory!
.showDrag(Vector2(100 + body.position.x, body.position.y), dragDiff!);
} else {
throwingTrajectory!.hideDrag();
}
Expand All @@ -117,10 +118,10 @@ class ThrowingTrajectoryComponent extends PositionComponent with HasPaint {
super.render(canvas);
if (!show) return;
for (int time = 0; time < 10; time++) {
double x = position.x -
double x = -position.x -
velocity.x * time -
(game.world.gravity.x / 2) * time * time;
double y = position.y +
double y = -position.y +
(velocity.y * time - (game.world.gravity.y / 2) * time * time);
canvas.drawCircle(Offset(x, y), 5, paint);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/game/game_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _AppGameViewState extends State<AppGameView> {

Future<void> play() async {
await player.setAsset('assets/audio/pixies-where-is-my-mind.mp3');
player.play();
// player.play();
}

@override
Expand Down

0 comments on commit 36cb273

Please sign in to comment.