You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pinball/lib/game/components/pathway.dart

210 lines
5.6 KiB

import 'package:flame/extensions.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flutter/material.dart';
import 'package:geometry/geometry.dart';
import 'package:pinball/game/game.dart';
/// {@template pathway}
/// [Pathway] creates lines of various shapes.
///
/// [BodyComponent]s such as a Ball can collide and move along a [Pathway].
/// {@endtemplate}
feat: crossing upper ramps (#40) * feat: added generic area and area callback for ramps crossing * feat: added jetpack ramp (blue one) and own area, contact callback and maskbits * feat: added sparky ramp (yellow one) and own area, contact callback and maskbits * feat: included ramp components * feat: added maskbits to ball for collisions * feat: added paths to pinball game * feat: added maskbits to paths * fix: fixed collisions of a ball that only touch path entrance but doesn't get into * fix: analysis warnings * feat: ball default maskbits * chore: refactor some names and vars * test: tests for ramps and callbacks, and coverage * test: pinball game check ramps are added * test: tests for ramps check childrens * test: fixing tests for ramps * test: fix tests * chore: increase sparky angle * fix: placed plunge aligned with straight launcher path * fix: fixed maskBits change for ball on crossing ramps and tests coverage * doc: public member api docs * chore: placed launcher ramp * test: moved mock from crossing ramps to helpers file * fix: build and dep where broken by forge2d/position_body_component * Update lib/game/components/crossing_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/jetpack_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/sparky_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * chore: fixed formatting * chore: removed coverage tool * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/ball_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/pinball_game_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * test: fix tests and groups * chore: ramp area name changed to opening * refactor: ball with mixin Layer for mask collisions * chore: avoid foreach in a function literal * refactor: hide maskbits and manage only with layer param * chore: formatting file * refactor: changed name for ramp area * refactor: sparky+launcher into one path * doc: doc layer for ball * refactor: sparky to launcher * feat: allow jetpack ramp to be over the board * feat: refactor to allow jetpack ramp to be above board and launcher ramp * test: coverage * fix: fixed conflict with merge Component position * chore: analysis fixes * chore: doc and comments * refactor: initial position to ramps and cleaned ramp callbacks * refactor: improved ramp contact callback * refactor: ball layer and ramp addAll components * refactor: create fixtures for pathways and opening improved * refactor: placed ramps on pinball game * refactor: splitted layer from rampopening * refactor: rampopening with layered mixin * test: fixed all changes with tests * test: fixed tests after Layer mixin changes * chore: refactor names, test and doc * chore: review docs and names * fix: fixed tests and bug with initialposition collision * chore: analysis error * fix: fixed collision end from ramps * test: coverage * chore: fixed spaces between methods and other comments from pr * chore: remove unnecessary layer set on Layered * fix: removed unrelated files from pr * chore: removed unused import * refactor: ballsInside private and removed from tests * chore: todo comment * chore: removed unused import * chore: removed podfile * doc: changed Layered doc * doc: changed Layered doc * Update test/game/components/ramp_opening_test.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/game/components/layer.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * docs: improved punctuation Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
class Pathway extends BodyComponent with InitialPosition, Layered {
Pathway._({
// TODO(ruialonso): remove color when assets added.
Color? color,
required List<List<Vector2>> paths,
}) : _paths = paths {
paint = Paint()
..color = color ?? const Color.fromARGB(0, 0, 0, 0)
..style = PaintingStyle.stroke;
}
/// Creates a uniform unidirectional (straight) [Pathway].
///
/// Does so with two [ChainShape] separated by a [width]. Can
/// be rotated by a given [rotation] in radians.
///
/// If [singleWall] is true, just one [ChainShape] is created.
factory Pathway.straight({
Color? color,
required Vector2 start,
required Vector2 end,
required double width,
double rotation = 0,
bool singleWall = false,
}) {
final paths = <List<Vector2>>[];
// TODO(ruialonso): Refactor repetitive logic
final firstWall = [
start.clone(),
end.clone(),
].map((vector) => vector..rotate(rotation)).toList();
paths.add(firstWall);
if (!singleWall) {
final secondWall = [
start + Vector2(width, 0),
end + Vector2(width, 0),
].map((vector) => vector..rotate(rotation)).toList();
paths.add(secondWall);
}
return Pathway._(
color: color,
paths: paths,
);
}
/// Creates an arc [Pathway].
///
/// The [angle], in radians, specifies the size of the arc. For example, two
/// pi returns a complete circumference.
///
/// Does so with two [ChainShape] separated by a [width]. Which can be
/// rotated by a given [rotation] in radians.
///
/// The outer radius is specified by [radius], whilst the inner one is
/// equivalent to the [radius] minus the [width].
///
/// If [singleWall] is true, just one [ChainShape] is created.
factory Pathway.arc({
Color? color,
required Vector2 center,
required double width,
required double radius,
required double angle,
double rotation = 0,
bool singleWall = false,
}) {
final paths = <List<Vector2>>[];
// TODO(ruialonso): Refactor repetitive logic
final outerWall = calculateArc(
center: center,
radius: radius,
angle: angle,
offsetAngle: rotation,
);
paths.add(outerWall);
if (!singleWall) {
final innerWall = calculateArc(
center: center,
radius: radius - width,
angle: angle,
offsetAngle: rotation,
);
paths.add(innerWall);
}
return Pathway._(
color: color,
paths: paths,
);
}
/// Creates a bezier curve [Pathway].
///
/// Does so with two [ChainShape] separated by a [width]. Which can be
/// rotated by a given [rotation] in radians.
///
/// First and last [controlPoints] set the beginning and end of the curve,
/// inner points between them set its final shape.
///
/// If [singleWall] is true, just one [ChainShape] is created.
factory Pathway.bezierCurve({
Color? color,
required List<Vector2> controlPoints,
required double width,
double rotation = 0,
bool singleWall = false,
}) {
final paths = <List<Vector2>>[];
// TODO(ruialonso): Refactor repetitive logic
final firstWall = calculateBezierCurve(controlPoints: controlPoints)
.map((vector) => vector..rotate(rotation))
.toList();
paths.add(firstWall);
if (!singleWall) {
final secondWall = calculateBezierCurve(
controlPoints: controlPoints
.map((vector) => vector + Vector2(width, -width))
.toList(),
).map((vector) => vector..rotate(rotation)).toList();
paths.add(secondWall);
}
return Pathway._(
color: color,
paths: paths,
);
}
/// Creates an ellipse [Pathway].
///
/// Does so with two [ChainShape]s separated by a [width]. Can
/// be rotated by a given [rotation] in radians.
///
/// If [singleWall] is true, just one [ChainShape] is created.
factory Pathway.ellipse({
Color? color,
required Vector2 center,
required double width,
required double majorRadius,
required double minorRadius,
double rotation = 0,
bool singleWall = false,
}) {
final paths = <List<Vector2>>[];
// TODO(ruialonso): Refactor repetitive logic
final outerWall = calculateEllipse(
center: center,
majorRadius: majorRadius,
minorRadius: minorRadius,
).map((vector) => vector..rotate(rotation)).toList();
paths.add(outerWall);
if (!singleWall) {
final innerWall = calculateEllipse(
center: center,
majorRadius: majorRadius - width,
minorRadius: minorRadius - width,
).map((vector) => vector..rotate(rotation)).toList();
paths.add(innerWall);
}
return Pathway._(
color: color,
paths: paths,
);
}
final List<List<Vector2>> _paths;
/// Constructs different [ChainShape]s to form the [Pathway] shape.
List<FixtureDef> createFixtureDefs() {
feat: crossing upper ramps (#40) * feat: added generic area and area callback for ramps crossing * feat: added jetpack ramp (blue one) and own area, contact callback and maskbits * feat: added sparky ramp (yellow one) and own area, contact callback and maskbits * feat: included ramp components * feat: added maskbits to ball for collisions * feat: added paths to pinball game * feat: added maskbits to paths * fix: fixed collisions of a ball that only touch path entrance but doesn't get into * fix: analysis warnings * feat: ball default maskbits * chore: refactor some names and vars * test: tests for ramps and callbacks, and coverage * test: pinball game check ramps are added * test: tests for ramps check childrens * test: fixing tests for ramps * test: fix tests * chore: increase sparky angle * fix: placed plunge aligned with straight launcher path * fix: fixed maskBits change for ball on crossing ramps and tests coverage * doc: public member api docs * chore: placed launcher ramp * test: moved mock from crossing ramps to helpers file * fix: build and dep where broken by forge2d/position_body_component * Update lib/game/components/crossing_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/jetpack_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/sparky_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * chore: fixed formatting * chore: removed coverage tool * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/ball_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/pinball_game_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * test: fix tests and groups * chore: ramp area name changed to opening * refactor: ball with mixin Layer for mask collisions * chore: avoid foreach in a function literal * refactor: hide maskbits and manage only with layer param * chore: formatting file * refactor: changed name for ramp area * refactor: sparky+launcher into one path * doc: doc layer for ball * refactor: sparky to launcher * feat: allow jetpack ramp to be over the board * feat: refactor to allow jetpack ramp to be above board and launcher ramp * test: coverage * fix: fixed conflict with merge Component position * chore: analysis fixes * chore: doc and comments * refactor: initial position to ramps and cleaned ramp callbacks * refactor: improved ramp contact callback * refactor: ball layer and ramp addAll components * refactor: create fixtures for pathways and opening improved * refactor: placed ramps on pinball game * refactor: splitted layer from rampopening * refactor: rampopening with layered mixin * test: fixed all changes with tests * test: fixed tests after Layer mixin changes * chore: refactor names, test and doc * chore: review docs and names * fix: fixed tests and bug with initialposition collision * chore: analysis error * fix: fixed collision end from ramps * test: coverage * chore: fixed spaces between methods and other comments from pr * chore: remove unnecessary layer set on Layered * fix: removed unrelated files from pr * chore: removed unused import * refactor: ballsInside private and removed from tests * chore: todo comment * chore: removed unused import * chore: removed podfile * doc: changed Layered doc * doc: changed Layered doc * Update test/game/components/ramp_opening_test.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/game/components/layer.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * docs: improved punctuation Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
final fixturesDef = <FixtureDef>[];
for (final path in _paths) {
final chain = ChainShape()..createChain(path);
feat: crossing upper ramps (#40) * feat: added generic area and area callback for ramps crossing * feat: added jetpack ramp (blue one) and own area, contact callback and maskbits * feat: added sparky ramp (yellow one) and own area, contact callback and maskbits * feat: included ramp components * feat: added maskbits to ball for collisions * feat: added paths to pinball game * feat: added maskbits to paths * fix: fixed collisions of a ball that only touch path entrance but doesn't get into * fix: analysis warnings * feat: ball default maskbits * chore: refactor some names and vars * test: tests for ramps and callbacks, and coverage * test: pinball game check ramps are added * test: tests for ramps check childrens * test: fixing tests for ramps * test: fix tests * chore: increase sparky angle * fix: placed plunge aligned with straight launcher path * fix: fixed maskBits change for ball on crossing ramps and tests coverage * doc: public member api docs * chore: placed launcher ramp * test: moved mock from crossing ramps to helpers file * fix: build and dep where broken by forge2d/position_body_component * Update lib/game/components/crossing_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/jetpack_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/sparky_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * chore: fixed formatting * chore: removed coverage tool * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/ball_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/pinball_game_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * test: fix tests and groups * chore: ramp area name changed to opening * refactor: ball with mixin Layer for mask collisions * chore: avoid foreach in a function literal * refactor: hide maskbits and manage only with layer param * chore: formatting file * refactor: changed name for ramp area * refactor: sparky+launcher into one path * doc: doc layer for ball * refactor: sparky to launcher * feat: allow jetpack ramp to be over the board * feat: refactor to allow jetpack ramp to be above board and launcher ramp * test: coverage * fix: fixed conflict with merge Component position * chore: analysis fixes * chore: doc and comments * refactor: initial position to ramps and cleaned ramp callbacks * refactor: improved ramp contact callback * refactor: ball layer and ramp addAll components * refactor: create fixtures for pathways and opening improved * refactor: placed ramps on pinball game * refactor: splitted layer from rampopening * refactor: rampopening with layered mixin * test: fixed all changes with tests * test: fixed tests after Layer mixin changes * chore: refactor names, test and doc * chore: review docs and names * fix: fixed tests and bug with initialposition collision * chore: analysis error * fix: fixed collision end from ramps * test: coverage * chore: fixed spaces between methods and other comments from pr * chore: remove unnecessary layer set on Layered * fix: removed unrelated files from pr * chore: removed unused import * refactor: ballsInside private and removed from tests * chore: todo comment * chore: removed unused import * chore: removed podfile * doc: changed Layered doc * doc: changed Layered doc * Update test/game/components/ramp_opening_test.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/game/components/layer.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * docs: improved punctuation Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
fixturesDef.add(FixtureDef(chain));
}
feat: crossing upper ramps (#40) * feat: added generic area and area callback for ramps crossing * feat: added jetpack ramp (blue one) and own area, contact callback and maskbits * feat: added sparky ramp (yellow one) and own area, contact callback and maskbits * feat: included ramp components * feat: added maskbits to ball for collisions * feat: added paths to pinball game * feat: added maskbits to paths * fix: fixed collisions of a ball that only touch path entrance but doesn't get into * fix: analysis warnings * feat: ball default maskbits * chore: refactor some names and vars * test: tests for ramps and callbacks, and coverage * test: pinball game check ramps are added * test: tests for ramps check childrens * test: fixing tests for ramps * test: fix tests * chore: increase sparky angle * fix: placed plunge aligned with straight launcher path * fix: fixed maskBits change for ball on crossing ramps and tests coverage * doc: public member api docs * chore: placed launcher ramp * test: moved mock from crossing ramps to helpers file * fix: build and dep where broken by forge2d/position_body_component * Update lib/game/components/crossing_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/jetpack_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/sparky_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * chore: fixed formatting * chore: removed coverage tool * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/ball_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/pinball_game_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * test: fix tests and groups * chore: ramp area name changed to opening * refactor: ball with mixin Layer for mask collisions * chore: avoid foreach in a function literal * refactor: hide maskbits and manage only with layer param * chore: formatting file * refactor: changed name for ramp area * refactor: sparky+launcher into one path * doc: doc layer for ball * refactor: sparky to launcher * feat: allow jetpack ramp to be over the board * feat: refactor to allow jetpack ramp to be above board and launcher ramp * test: coverage * fix: fixed conflict with merge Component position * chore: analysis fixes * chore: doc and comments * refactor: initial position to ramps and cleaned ramp callbacks * refactor: improved ramp contact callback * refactor: ball layer and ramp addAll components * refactor: create fixtures for pathways and opening improved * refactor: placed ramps on pinball game * refactor: splitted layer from rampopening * refactor: rampopening with layered mixin * test: fixed all changes with tests * test: fixed tests after Layer mixin changes * chore: refactor names, test and doc * chore: review docs and names * fix: fixed tests and bug with initialposition collision * chore: analysis error * fix: fixed collision end from ramps * test: coverage * chore: fixed spaces between methods and other comments from pr * chore: remove unnecessary layer set on Layered * fix: removed unrelated files from pr * chore: removed unused import * refactor: ballsInside private and removed from tests * chore: todo comment * chore: removed unused import * chore: removed podfile * doc: changed Layered doc * doc: changed Layered doc * Update test/game/components/ramp_opening_test.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/game/components/layer.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * docs: improved punctuation Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
return fixturesDef;
}
@override
Body createBody() {
final bodyDef = BodyDef()..position = initialPosition;
final body = world.createBody(bodyDef);
createFixtureDefs().forEach(body.createFixture);
feat: crossing upper ramps (#40) * feat: added generic area and area callback for ramps crossing * feat: added jetpack ramp (blue one) and own area, contact callback and maskbits * feat: added sparky ramp (yellow one) and own area, contact callback and maskbits * feat: included ramp components * feat: added maskbits to ball for collisions * feat: added paths to pinball game * feat: added maskbits to paths * fix: fixed collisions of a ball that only touch path entrance but doesn't get into * fix: analysis warnings * feat: ball default maskbits * chore: refactor some names and vars * test: tests for ramps and callbacks, and coverage * test: pinball game check ramps are added * test: tests for ramps check childrens * test: fixing tests for ramps * test: fix tests * chore: increase sparky angle * fix: placed plunge aligned with straight launcher path * fix: fixed maskBits change for ball on crossing ramps and tests coverage * doc: public member api docs * chore: placed launcher ramp * test: moved mock from crossing ramps to helpers file * fix: build and dep where broken by forge2d/position_body_component * Update lib/game/components/crossing_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/jetpack_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update test/game/components/sparky_ramp_test.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * chore: fixed formatting * chore: removed coverage tool * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/ball_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/crossing_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update lib/game/components/jetpack_ramp.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/crossing_ramp_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/pinball_game_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * Update test/game/components/pathway_test.dart Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> * test: fix tests and groups * chore: ramp area name changed to opening * refactor: ball with mixin Layer for mask collisions * chore: avoid foreach in a function literal * refactor: hide maskbits and manage only with layer param * chore: formatting file * refactor: changed name for ramp area * refactor: sparky+launcher into one path * doc: doc layer for ball * refactor: sparky to launcher * feat: allow jetpack ramp to be over the board * feat: refactor to allow jetpack ramp to be above board and launcher ramp * test: coverage * fix: fixed conflict with merge Component position * chore: analysis fixes * chore: doc and comments * refactor: initial position to ramps and cleaned ramp callbacks * refactor: improved ramp contact callback * refactor: ball layer and ramp addAll components * refactor: create fixtures for pathways and opening improved * refactor: placed ramps on pinball game * refactor: splitted layer from rampopening * refactor: rampopening with layered mixin * test: fixed all changes with tests * test: fixed tests after Layer mixin changes * chore: refactor names, test and doc * chore: review docs and names * fix: fixed tests and bug with initialposition collision * chore: analysis error * fix: fixed collision end from ramps * test: coverage * chore: fixed spaces between methods and other comments from pr * chore: remove unnecessary layer set on Layered * fix: removed unrelated files from pr * chore: removed unused import * refactor: ballsInside private and removed from tests * chore: todo comment * chore: removed unused import * chore: removed podfile * doc: changed Layered doc * doc: changed Layered doc * Update test/game/components/ramp_opening_test.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/game/components/layer.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * docs: improved punctuation Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
return body;
}
}