diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index d5db36b..489fa20 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -1,8 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Flutter on: diff --git a/README.md b/README.md index 8e586c4..08885a0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# BullsEye +# Bullseye -A game written in Flutter, based on a tutorial with my own tweaks added. \ No newline at end of file +A game written in Flutter based on a tutorial, with my own tweaks added. \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 2dea0ed..6f713e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -116,6 +116,13 @@ class _GamePageState extends State { ); } + int _pointsForCurrentRound() { + var maxScore = 100; + var difference = (_model.target - _model.current).abs(); + + return maxScore - difference; + } + void _showAlert(BuildContext context) { var okButton = PlatformTextButton( child: PlatformText("Awesome!"), @@ -130,7 +137,8 @@ class _GamePageState extends State { builder: (BuildContext context) { return PlatformAlertDialog( title: PlatformText("Hello There."), - content: PlatformText("The slider's value is ${_model.current}"), + content: PlatformText("The slider's value is ${_model.current}\n" + + "You scored ${_pointsForCurrentRound()} points this round."), actions: [okButton], ); }); diff --git a/pubspec.yaml b/pubspec.yaml index 0b1ca1d..444981b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: bullseye -description: A new Flutter project. +description: A game written in Flutter based on a tutorial, with my own tweaks added. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. @@ -46,8 +46,7 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + # - images/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see