Skip to content

Commit

Permalink
possible fix for collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
aruhant committed Feb 8, 2024
1 parent b989c74 commit 804701f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Binary file modified app/assets/images/platform/fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions app/lib/game/flammable_decoration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class FlammableDecoration extends GameDecoration with Sensor {
required Vector2 position,
}) : super.withAnimation(
animation: PlatformSpritesheet.fire,
position: position..translate(0, -8),
size: Vector2(128 * 1.5, 128 * 1.5),
position: position..translate(0, -20),
size: Vector2(128 * 1.2, 128 * 1.2),
) {}

@override
void onContactExit(GameComponent component) => onContact(component);

@override
void onContact(GameComponent component) {
if (component is Player && !_onFire) {
Expand All @@ -24,7 +27,7 @@ class FlammableDecoration extends GameDecoration with Sensor {
PlatformSpritesheet.fireOn.then((fire) {
setAnimation(fire);
size = Vector2(128 * 1.5, 116 * 3);
position = position..translate(0, -116);
position = position..translate(0, -106);
_onFire = true;
});
}
Expand Down
7 changes: 4 additions & 3 deletions app/lib/game/ui/score_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ class ProgressBarWidget extends StatelessWidget {
listenable: controller,
builder: (context, _) {
return Padding(
padding: const EdgeInsets.only(left: 45, top: 60),
padding: const EdgeInsets.only(left: 40, top: 40),
child: Column(
children: [
Row(
children: [
Text(
'${(controller.goals).toInt()}🔥 ${(controller.enemies).toInt()} 👹',
style: const TextStyle(color: Colors.yellowAccent),
'${(controller.goals).toInt()} 🔥 ${(controller.enemies).toInt()} 👹',
style: const TextStyle(
color: Colors.yellowAccent, fontSize: 20),
)
],
),
Expand Down

0 comments on commit 804701f

Please sign in to comment.