├── .gitignore ├── .metadata ├── analysis_options.yaml ├── assets ├── README.md └── cannon ball_2.png ├── lib ├── game_widget.dart ├── main.dart ├── steps │ ├── step01.dart │ ├── step02.dart │ ├── step03.dart │ ├── step04.dart │ ├── step05.dart │ ├── step06.dart │ ├── step07.dart │ ├── step08.dart │ ├── step09.dart │ ├── step10.dart │ ├── step11.dart │ ├── step12.dart │ ├── step13.dart │ └── step14.dart └── world.dart ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml └── web ├── favicon.png ├── icons ├── Icon-192.png ├── Icon-512.png ├── Icon-maskable-192.png └── Icon-maskable-512.png ├── index.html └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Symbolication related 35 | app.*.symbols 36 | 37 | # Obfuscation related 38 | app.*.map.json 39 | 40 | # Android Studio will place build artifacts here 41 | /android/app/debug 42 | /android/app/profile 43 | /android/app/release 44 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "603104015dd692ea3403755b55d07813d5cf8965" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965 17 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965 18 | - platform: macos 19 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965 20 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965 21 | - platform: web 22 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965 23 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # Credits 2 | 3 | The file `cannon ball_2.png` is a free and open asset 4 | by Flixberry Entertainment, downloaded 5 | [from OpenGameArt.org](https://opengameart.org/content/cannonball). 6 | -------------------------------------------------------------------------------- /assets/cannon ball_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/assets/cannon ball_2.png -------------------------------------------------------------------------------- /lib/game_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_game_physics/world.dart'; 3 | import 'package:vector_math/vector_math_64.dart'; 4 | 5 | class GameWidget extends StatefulWidget { 6 | final Size size; 7 | 8 | final double scale; 9 | 10 | final World world; 11 | 12 | final ValueNotifier mouseOffset; 13 | 14 | final ValueNotifier mouseClicked; 15 | 16 | const GameWidget({ 17 | required this.world, 18 | required this.size, 19 | required this.scale, 20 | required this.mouseOffset, 21 | required this.mouseClicked, 22 | super.key, 23 | }); 24 | 25 | @override 26 | State createState() => _GameWidgetState(); 27 | } 28 | 29 | class _GameWidgetState extends State 30 | with SingleTickerProviderStateMixin { 31 | AnimationController? _controller; 32 | 33 | bool _loaded = false; 34 | 35 | DateTime _lastTime = DateTime.now(); 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | if (!_loaded) { 40 | return const Center(child: Text('Loading...')); 41 | } 42 | 43 | final scale = widget.scale; 44 | 45 | return Stack( 46 | children: [ 47 | const SizedBox.expand(), 48 | Positioned( 49 | left: (widget.world.ball.x - widget.world.ball.size / 2) * scale, 50 | top: (widget.world.ball.y - widget.world.ball.size / 2) * scale, 51 | child: Image.asset( 52 | 'assets/cannon ball_2.png', 53 | scale: 5 / scale, 54 | ), 55 | ), 56 | ], 57 | ); 58 | } 59 | 60 | @override 61 | void dispose() { 62 | _controller?.dispose(); 63 | super.dispose(); 64 | } 65 | 66 | @override 67 | void initState() { 68 | super.initState(); 69 | 70 | _controller = 71 | AnimationController(vsync: this, duration: const Duration(seconds: 1)); 72 | _controller!.repeat(); 73 | _controller!.addListener(() => setState(() { 74 | final world = widget.world; 75 | world.mousePosition.setFrom(widget.mouseOffset.value); 76 | world.mouseClicked = widget.mouseClicked.value; 77 | world.size = widget.size; 78 | 79 | final now = DateTime.now(); 80 | final dt = now.difference(_lastTime).inMilliseconds / 1000.0; 81 | world.update(dt); 82 | _lastTime = now; 83 | widget.mouseClicked.value = false; 84 | 85 | // Special logic so we don't need to pollute the update 86 | // function with this from the start. 87 | if (world.ball.x - world.ball.size / 2 > widget.size.width) { 88 | world.reset(); 89 | } 90 | if (world.ball.x < -world.ball.size) { 91 | world.reset(); 92 | } 93 | })); 94 | _loaded = true; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_game_physics/game_widget.dart'; 3 | import 'package:flutter_game_physics/steps/step01.dart'; 4 | import 'package:flutter_game_physics/steps/step02.dart'; 5 | import 'package:flutter_game_physics/steps/step03.dart'; 6 | import 'package:flutter_game_physics/steps/step04.dart'; 7 | import 'package:flutter_game_physics/steps/step05.dart'; 8 | import 'package:flutter_game_physics/steps/step06.dart'; 9 | import 'package:flutter_game_physics/steps/step07.dart'; 10 | import 'package:flutter_game_physics/steps/step08.dart'; 11 | import 'package:flutter_game_physics/steps/step09.dart'; 12 | import 'package:flutter_game_physics/steps/step10.dart'; 13 | import 'package:flutter_game_physics/steps/step11.dart'; 14 | import 'package:flutter_game_physics/steps/step12.dart'; 15 | import 'package:flutter_game_physics/steps/step13.dart'; 16 | import 'package:flutter_game_physics/steps/step14.dart'; 17 | import 'package:flutter_game_physics/world.dart'; 18 | import 'package:vector_math/vector_math_64.dart' hide Colors; 19 | 20 | void main() { 21 | runApp(const MyBasicGame()); 22 | } 23 | 24 | class MyBasicGame extends StatefulWidget { 25 | const MyBasicGame({super.key}); 26 | 27 | @override 28 | State createState() => _MyBasicGameState(); 29 | } 30 | 31 | class _MyBasicGameState extends State { 32 | static final List steps = [ 33 | () => Step1(), 34 | () => Step2(), 35 | () => Step3(), 36 | () => Step4(), 37 | () => Step5(), 38 | () => Step6(), 39 | () => Step7(), 40 | () => Step8(), 41 | () => Step9(), 42 | () => Step10(), 43 | () => Step11(), 44 | () => Step12(), 45 | () => Step13(), 46 | () => Step14(), 47 | ]; 48 | 49 | final ValueNotifier mouseOffset = ValueNotifier(Vector2(0, 100)); 50 | 51 | final ValueNotifier mouseClicked = ValueNotifier(false); 52 | 53 | final Size size = const Size(400, 300); 54 | 55 | final double scale = 2; 56 | 57 | int stepIndex = 0; 58 | 59 | @override 60 | Widget build(BuildContext context) { 61 | final step = steps[stepIndex](); 62 | 63 | return MaterialApp( 64 | title: 'Basic Game Physics', 65 | debugShowCheckedModeBanner: false, 66 | theme: ThemeData( 67 | colorScheme: const ColorScheme.dark( 68 | primary: Colors.blue, 69 | ), 70 | useMaterial3: true, 71 | ), 72 | home: Scaffold( 73 | appBar: AppBar( 74 | title: Text(step.runtimeType.toString()), 75 | actions: [ 76 | IconButton( 77 | icon: const Icon(Icons.arrow_back), 78 | onPressed: () => 79 | setState(() => stepIndex = (stepIndex - 1) % steps.length), 80 | ), 81 | IconButton( 82 | icon: const Icon(Icons.arrow_forward), 83 | onPressed: () => 84 | setState(() => stepIndex = (stepIndex + 1) % steps.length), 85 | ), 86 | ], 87 | ), 88 | backgroundColor: Colors.blue, 89 | body: Center( 90 | child: DecoratedBox( 91 | decoration: BoxDecoration( 92 | border: Border.all( 93 | color: Colors.white, 94 | width: 5, 95 | strokeAlign: BorderSide.strokeAlignOutside), 96 | ), 97 | child: SizedBox.fromSize( 98 | size: size * 2, 99 | child: GestureDetector( 100 | onTap: () => mouseClicked.value = true, 101 | child: MouseRegion( 102 | onHover: (event) => mouseOffset.value = 103 | Vector2(event.localPosition.dx, event.localPosition.dy) / 104 | scale, 105 | child: GameWidget( 106 | world: step, 107 | size: size, 108 | scale: scale, 109 | mouseOffset: mouseOffset, 110 | mouseClicked: mouseClicked, 111 | ), 112 | ), 113 | ), 114 | ), 115 | ), 116 | ), 117 | ), 118 | ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /lib/steps/step01.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | 5 | class Step1 extends World1 { 6 | final Cannonball ball = Cannonball(); 7 | 8 | void update1() { 9 | // Update. 10 | } 11 | } 12 | 13 | class Cannonball extends CannonballBase { 14 | double x = 0; 15 | double y = 100; 16 | } 17 | -------------------------------------------------------------------------------- /lib/steps/step02.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | 5 | class Step2 extends World1 { 6 | final Cannonball ball = Cannonball(); 7 | 8 | void update1() { 9 | ball.x = ball.x + 1; 10 | } 11 | } 12 | 13 | class Cannonball extends CannonballBase { 14 | double x = 0; 15 | double y = 100; 16 | } 17 | -------------------------------------------------------------------------------- /lib/steps/step03.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | 5 | class Step3 extends World { 6 | final Cannonball ball = Cannonball(); 7 | 8 | void update(double dt) { 9 | const speed = 100.0; 10 | ball.x = ball.x + speed * dt; 11 | } 12 | } 13 | 14 | class Cannonball extends CannonballBase { 15 | double x = 0; 16 | double y = 100; 17 | } 18 | -------------------------------------------------------------------------------- /lib/steps/step04.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step4 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | const speed = 100.0; 11 | ball.position = ball.position + Vector2(speed * dt, 0); 12 | } 13 | } 14 | 15 | class Cannonball extends CannonballVectorBase { 16 | Vector2 position = Vector2(0, 100); 17 | } 18 | -------------------------------------------------------------------------------- /lib/steps/step05.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step5 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | var velocity = Vector2(99, 20); 11 | ball.position = ball.position + velocity * dt; 12 | } 13 | } 14 | 15 | class Cannonball extends CannonballVectorBase { 16 | Vector2 position = Vector2(0, 100); 17 | } 18 | -------------------------------------------------------------------------------- /lib/steps/step06.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step6 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | ball.position = ball.position + ball.velocity * dt; 11 | } 12 | } 13 | 14 | class Cannonball extends CannonballVectorBase { 15 | Vector2 position = Vector2(0, 100); 16 | 17 | Vector2 velocity = Vector2(99, 20); 18 | } 19 | -------------------------------------------------------------------------------- /lib/steps/step07.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step7 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | ball.position = ball.position + ball.velocity * dt; 11 | 12 | final acceleration = mousePosition - ball.position; 13 | ball.velocity = ball.velocity + acceleration * dt; 14 | } 15 | } 16 | 17 | class Cannonball extends CannonballVectorBase { 18 | Vector2 position = Vector2(0, 100); 19 | 20 | Vector2 velocity = Vector2(0, 0); 21 | } 22 | -------------------------------------------------------------------------------- /lib/steps/step08.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step8 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final acceleration = (mousePosition - ball.position); 11 | ball.velocity = ball.velocity + acceleration * dt; 12 | 13 | ball.position = ball.position + ball.velocity * dt; 14 | } 15 | } 16 | 17 | class Cannonball extends CannonballVectorBase { 18 | Vector2 position = Vector2(0, 100); 19 | 20 | Vector2 velocity = Vector2(0, 0); 21 | } 22 | -------------------------------------------------------------------------------- /lib/steps/step09.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step9 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final acceleration = Vector2(0, 20); 11 | ball.velocity = ball.velocity + acceleration * dt; 12 | 13 | ball.position = ball.position + ball.velocity * dt; 14 | } 15 | } 16 | 17 | class Cannonball extends CannonballVectorBase2 { 18 | Vector2 position = Vector2(0, 100); 19 | 20 | Vector2 velocity = Vector2(50, 0); 21 | } 22 | -------------------------------------------------------------------------------- /lib/steps/step10.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step10 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final acceleration = Vector2(0, 20); 11 | ball.velocity = ball.velocity + acceleration * dt; 12 | 13 | ball.position = ball.position + ball.velocity * dt; 14 | 15 | if (ball.position.y + ball.size / 2 >= size.height) { 16 | ball.position.y = size.height - ball.size / 2; 17 | ball.velocity.y = 0; 18 | } 19 | } 20 | } 21 | 22 | class Cannonball extends CannonballVectorBase2 { 23 | Vector2 position = Vector2(0, 100); 24 | 25 | Vector2 velocity = Vector2(50, 0); 26 | } 27 | -------------------------------------------------------------------------------- /lib/steps/step11.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step11 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final acceleration = Vector2(0, 20); 11 | ball.velocity = ball.velocity + acceleration * dt; 12 | 13 | ball.position = ball.position + ball.velocity * dt; 14 | 15 | if (ball.position.y + ball.size / 2 >= size.height) { 16 | ball.position.y = size.height - ball.size / 2; 17 | ball.velocity.y = -0.5 * ball.velocity.y; 18 | } 19 | } 20 | } 21 | 22 | class Cannonball extends CannonballVectorBase2 { 23 | Vector2 position = Vector2(0, 100); 24 | 25 | Vector2 velocity = Vector2(50, 0); 26 | } 27 | -------------------------------------------------------------------------------- /lib/steps/step12.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step12 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final magneticForce = Vector2(-1000, 0); 11 | final magneticAcceleration = magneticForce / ball.mass; 12 | final gravitationalAcceleration = Vector2(0, 20); 13 | 14 | final acceleration = magneticAcceleration + gravitationalAcceleration; 15 | ball.velocity = ball.velocity + acceleration * dt; 16 | 17 | ball.position = ball.position + ball.velocity * dt; 18 | 19 | if (ball.position.y + ball.size / 2 >= size.height) { 20 | ball.position.y = size.height - ball.size / 2; 21 | ball.velocity.y = -0.5 * ball.velocity.y; 22 | } 23 | } 24 | } 25 | 26 | class Cannonball extends CannonballVectorBase2 { 27 | Vector2 position = Vector2(0, 100); 28 | 29 | Vector2 velocity = Vector2(50, 0); 30 | 31 | double mass = 100; 32 | } 33 | -------------------------------------------------------------------------------- /lib/steps/step13.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step13 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final gravitationalAcceleration = Vector2(0, 20); 11 | final airDrag = -ball.velocity.scaled(0.3); 12 | 13 | final acceleration = gravitationalAcceleration + airDrag; 14 | ball.velocity = ball.velocity + acceleration * dt; 15 | 16 | ball.position = ball.position + ball.velocity * dt; 17 | 18 | if (ball.position.y + ball.size / 2 >= size.height) { 19 | ball.position.y = size.height - ball.size / 2; 20 | ball.velocity.y = -0.5 * ball.velocity.y; 21 | } 22 | } 23 | } 24 | 25 | class Cannonball extends CannonballVectorBase2 { 26 | Vector2 position = Vector2(0, 100); 27 | 28 | Vector2 velocity = Vector2(50, 0); 29 | 30 | double mass = 100; 31 | } 32 | -------------------------------------------------------------------------------- /lib/steps/step14.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: annotate_overrides 2 | 3 | import 'package:flutter_game_physics/world.dart'; 4 | import 'package:vector_math/vector_math_64.dart'; 5 | 6 | class Step14 extends World { 7 | final Cannonball ball = Cannonball(); 8 | 9 | void update(double dt) { 10 | final gravitationalAcceleration = Vector2(0, 20); 11 | final airDrag = -ball.velocity.scaled(0.3); 12 | 13 | final acceleration = gravitationalAcceleration + airDrag; 14 | ball.velocity = ball.velocity + acceleration * dt; 15 | 16 | if (mouseClicked) { 17 | final impulse = (ball.position - mousePosition) 18 | ..normalize() 19 | ..scale(10000); 20 | 21 | ball.velocity = ball.velocity + impulse / ball.mass; 22 | } 23 | 24 | ball.position = ball.position + ball.velocity * dt; 25 | 26 | if (ball.position.y + ball.size / 2 >= size.height) { 27 | ball.position.y = size.height - ball.size / 2; 28 | ball.velocity.y = -0.5 * ball.velocity.y; 29 | } 30 | } 31 | } 32 | 33 | class Cannonball extends CannonballVectorBase2 { 34 | Vector2 position = Vector2(0, 100); 35 | 36 | Vector2 velocity = Vector2(50, 0); 37 | 38 | double mass = 100; 39 | } 40 | -------------------------------------------------------------------------------- /lib/world.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:vector_math/vector_math_64.dart'; 4 | 5 | abstract class World { 6 | CannonballBase get ball; 7 | 8 | final Vector2 mousePosition = Vector2(0, 100); 9 | 10 | bool mouseClicked = false; 11 | 12 | Size size = const Size(100, 100); 13 | 14 | void update(double dt); 15 | 16 | void reset() { 17 | ball.x = 0; 18 | ball.y = 100; 19 | 20 | if (ball is CannonballVectorBase2) { 21 | (ball as CannonballVectorBase2).velocity.setValues(50, 0); 22 | } 23 | } 24 | } 25 | 26 | // ignore: camel_case_types 27 | abstract class World1 extends World { 28 | @override 29 | void update(double dt) => update1(); 30 | 31 | void update1(); 32 | } 33 | 34 | abstract class CannonballBase { 35 | double get x; 36 | set x(double x); 37 | 38 | double get y; 39 | set y(double y); 40 | 41 | final double size = 248 / 5; 42 | } 43 | 44 | abstract class CannonballVectorBase extends CannonballBase { 45 | Vector2 get position; 46 | 47 | @override 48 | double get x => position.x; 49 | 50 | @override 51 | set x(double x) => position.x = x; 52 | 53 | @override 54 | double get y => position.y; 55 | 56 | @override 57 | set y(double y) => position.y = y; 58 | } 59 | 60 | abstract class CannonballVectorBase2 extends CannonballVectorBase { 61 | Vector2 get velocity; 62 | } 63 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; 13 | buildPhases = ( 14 | 33CC111E2044C6BF0003C045 /* ShellScript */, 15 | ); 16 | dependencies = ( 17 | ); 18 | name = "Flutter Assemble"; 19 | productName = FLX; 20 | }; 21 | /* End PBXAggregateTarget section */ 22 | 23 | /* Begin PBXBuildFile section */ 24 | 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; 25 | 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 26 | 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 27 | 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 28 | 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 29 | 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = 33CC10E52044A3C60003C045 /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 33CC10EC2044A3C60003C045; 38 | remoteInfo = Runner; 39 | }; 40 | 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 33CC10E52044A3C60003C045 /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 33CC111A2044C6BA0003C045; 45 | remoteInfo = FLX; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXCopyFilesBuildPhase section */ 50 | 33CC110E2044A8840003C045 /* Bundle Framework */ = { 51 | isa = PBXCopyFilesBuildPhase; 52 | buildActionMask = 2147483647; 53 | dstPath = ""; 54 | dstSubfolderSpec = 10; 55 | files = ( 56 | ); 57 | name = "Bundle Framework"; 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXCopyFilesBuildPhase section */ 61 | 62 | /* Begin PBXFileReference section */ 63 | 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 65 | 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 66 | 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; 67 | 33CC10ED2044A3C60003C045 /* flutter_game_physics.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_game_physics.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 69 | 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 70 | 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 71 | 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; 72 | 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; 73 | 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; 74 | 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; 75 | 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; 76 | 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 77 | 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 78 | 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; 79 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; 81 | /* End PBXFileReference section */ 82 | 83 | /* Begin PBXFrameworksBuildPhase section */ 84 | 331C80D2294CF70F00263BE5 /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | 33CC10EA2044A3C60003C045 /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | /* End PBXFrameworksBuildPhase section */ 99 | 100 | /* Begin PBXGroup section */ 101 | 331C80D6294CF71000263BE5 /* RunnerTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 331C80D7294CF71000263BE5 /* RunnerTests.swift */, 105 | ); 106 | path = RunnerTests; 107 | sourceTree = ""; 108 | }; 109 | 33BA886A226E78AF003329D5 /* Configs */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 33E5194F232828860026EE4D /* AppInfo.xcconfig */, 113 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 114 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 115 | 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, 116 | ); 117 | path = Configs; 118 | sourceTree = ""; 119 | }; 120 | 33CC10E42044A3C60003C045 = { 121 | isa = PBXGroup; 122 | children = ( 123 | 33FAB671232836740065AC1E /* Runner */, 124 | 33CEB47122A05771004F2AC0 /* Flutter */, 125 | 331C80D6294CF71000263BE5 /* RunnerTests */, 126 | 33CC10EE2044A3C60003C045 /* Products */, 127 | D73912EC22F37F3D000D13A0 /* Frameworks */, 128 | ); 129 | sourceTree = ""; 130 | }; 131 | 33CC10EE2044A3C60003C045 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 33CC10ED2044A3C60003C045 /* flutter_game_physics.app */, 135 | 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | 33CC11242044D66E0003C045 /* Resources */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 33CC10F22044A3C60003C045 /* Assets.xcassets */, 144 | 33CC10F42044A3C60003C045 /* MainMenu.xib */, 145 | 33CC10F72044A3C60003C045 /* Info.plist */, 146 | ); 147 | name = Resources; 148 | path = ..; 149 | sourceTree = ""; 150 | }; 151 | 33CEB47122A05771004F2AC0 /* Flutter */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, 155 | 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 156 | 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, 157 | 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, 158 | ); 159 | path = Flutter; 160 | sourceTree = ""; 161 | }; 162 | 33FAB671232836740065AC1E /* Runner */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 33CC10F02044A3C60003C045 /* AppDelegate.swift */, 166 | 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, 167 | 33E51913231747F40026EE4D /* DebugProfile.entitlements */, 168 | 33E51914231749380026EE4D /* Release.entitlements */, 169 | 33CC11242044D66E0003C045 /* Resources */, 170 | 33BA886A226E78AF003329D5 /* Configs */, 171 | ); 172 | path = Runner; 173 | sourceTree = ""; 174 | }; 175 | D73912EC22F37F3D000D13A0 /* Frameworks */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | ); 179 | name = Frameworks; 180 | sourceTree = ""; 181 | }; 182 | /* End PBXGroup section */ 183 | 184 | /* Begin PBXNativeTarget section */ 185 | 331C80D4294CF70F00263BE5 /* RunnerTests */ = { 186 | isa = PBXNativeTarget; 187 | buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; 188 | buildPhases = ( 189 | 331C80D1294CF70F00263BE5 /* Sources */, 190 | 331C80D2294CF70F00263BE5 /* Frameworks */, 191 | 331C80D3294CF70F00263BE5 /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | 331C80DA294CF71000263BE5 /* PBXTargetDependency */, 197 | ); 198 | name = RunnerTests; 199 | productName = RunnerTests; 200 | productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; 201 | productType = "com.apple.product-type.bundle.unit-test"; 202 | }; 203 | 33CC10EC2044A3C60003C045 /* Runner */ = { 204 | isa = PBXNativeTarget; 205 | buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; 206 | buildPhases = ( 207 | 33CC10E92044A3C60003C045 /* Sources */, 208 | 33CC10EA2044A3C60003C045 /* Frameworks */, 209 | 33CC10EB2044A3C60003C045 /* Resources */, 210 | 33CC110E2044A8840003C045 /* Bundle Framework */, 211 | 3399D490228B24CF009A79C7 /* ShellScript */, 212 | ); 213 | buildRules = ( 214 | ); 215 | dependencies = ( 216 | 33CC11202044C79F0003C045 /* PBXTargetDependency */, 217 | ); 218 | name = Runner; 219 | productName = Runner; 220 | productReference = 33CC10ED2044A3C60003C045 /* flutter_game_physics.app */; 221 | productType = "com.apple.product-type.application"; 222 | }; 223 | /* End PBXNativeTarget section */ 224 | 225 | /* Begin PBXProject section */ 226 | 33CC10E52044A3C60003C045 /* Project object */ = { 227 | isa = PBXProject; 228 | attributes = { 229 | BuildIndependentTargetsInParallel = YES; 230 | LastSwiftUpdateCheck = 0920; 231 | LastUpgradeCheck = 1510; 232 | ORGANIZATIONNAME = ""; 233 | TargetAttributes = { 234 | 331C80D4294CF70F00263BE5 = { 235 | CreatedOnToolsVersion = 14.0; 236 | TestTargetID = 33CC10EC2044A3C60003C045; 237 | }; 238 | 33CC10EC2044A3C60003C045 = { 239 | CreatedOnToolsVersion = 9.2; 240 | LastSwiftMigration = 1100; 241 | ProvisioningStyle = Automatic; 242 | SystemCapabilities = { 243 | com.apple.Sandbox = { 244 | enabled = 1; 245 | }; 246 | }; 247 | }; 248 | 33CC111A2044C6BA0003C045 = { 249 | CreatedOnToolsVersion = 9.2; 250 | ProvisioningStyle = Manual; 251 | }; 252 | }; 253 | }; 254 | buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; 255 | compatibilityVersion = "Xcode 9.3"; 256 | developmentRegion = en; 257 | hasScannedForEncodings = 0; 258 | knownRegions = ( 259 | en, 260 | Base, 261 | ); 262 | mainGroup = 33CC10E42044A3C60003C045; 263 | productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; 264 | projectDirPath = ""; 265 | projectRoot = ""; 266 | targets = ( 267 | 33CC10EC2044A3C60003C045 /* Runner */, 268 | 331C80D4294CF70F00263BE5 /* RunnerTests */, 269 | 33CC111A2044C6BA0003C045 /* Flutter Assemble */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 331C80D3294CF70F00263BE5 /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 33CC10EB2044A3C60003C045 /* Resources */ = { 283 | isa = PBXResourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 287 | 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | /* End PBXResourcesBuildPhase section */ 292 | 293 | /* Begin PBXShellScriptBuildPhase section */ 294 | 3399D490228B24CF009A79C7 /* ShellScript */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | alwaysOutOfDate = 1; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputFileListPaths = ( 301 | ); 302 | inputPaths = ( 303 | ); 304 | outputFileListPaths = ( 305 | ); 306 | outputPaths = ( 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | shellPath = /bin/sh; 310 | shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; 311 | }; 312 | 33CC111E2044C6BF0003C045 /* ShellScript */ = { 313 | isa = PBXShellScriptBuildPhase; 314 | buildActionMask = 2147483647; 315 | files = ( 316 | ); 317 | inputFileListPaths = ( 318 | Flutter/ephemeral/FlutterInputs.xcfilelist, 319 | ); 320 | inputPaths = ( 321 | Flutter/ephemeral/tripwire, 322 | ); 323 | outputFileListPaths = ( 324 | Flutter/ephemeral/FlutterOutputs.xcfilelist, 325 | ); 326 | outputPaths = ( 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | shellPath = /bin/sh; 330 | shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; 331 | }; 332 | /* End PBXShellScriptBuildPhase section */ 333 | 334 | /* Begin PBXSourcesBuildPhase section */ 335 | 331C80D1294CF70F00263BE5 /* Sources */ = { 336 | isa = PBXSourcesBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | 33CC10E92044A3C60003C045 /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, 348 | 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, 349 | 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXSourcesBuildPhase section */ 354 | 355 | /* Begin PBXTargetDependency section */ 356 | 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { 357 | isa = PBXTargetDependency; 358 | target = 33CC10EC2044A3C60003C045 /* Runner */; 359 | targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; 360 | }; 361 | 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { 362 | isa = PBXTargetDependency; 363 | target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; 364 | targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; 365 | }; 366 | /* End PBXTargetDependency section */ 367 | 368 | /* Begin PBXVariantGroup section */ 369 | 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { 370 | isa = PBXVariantGroup; 371 | children = ( 372 | 33CC10F52044A3C60003C045 /* Base */, 373 | ); 374 | name = MainMenu.xib; 375 | path = Runner; 376 | sourceTree = ""; 377 | }; 378 | /* End PBXVariantGroup section */ 379 | 380 | /* Begin XCBuildConfiguration section */ 381 | 331C80DB294CF71000263BE5 /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | BUNDLE_LOADER = "$(TEST_HOST)"; 385 | CURRENT_PROJECT_VERSION = 1; 386 | GENERATE_INFOPLIST_FILE = YES; 387 | MARKETING_VERSION = 1.0; 388 | PRODUCT_BUNDLE_IDENTIFIER = com.raindead.flutterGamePhysics.RunnerTests; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | SWIFT_VERSION = 5.0; 391 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_game_physics.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_game_physics"; 392 | }; 393 | name = Debug; 394 | }; 395 | 331C80DC294CF71000263BE5 /* Release */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | BUNDLE_LOADER = "$(TEST_HOST)"; 399 | CURRENT_PROJECT_VERSION = 1; 400 | GENERATE_INFOPLIST_FILE = YES; 401 | MARKETING_VERSION = 1.0; 402 | PRODUCT_BUNDLE_IDENTIFIER = com.raindead.flutterGamePhysics.RunnerTests; 403 | PRODUCT_NAME = "$(TARGET_NAME)"; 404 | SWIFT_VERSION = 5.0; 405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_game_physics.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_game_physics"; 406 | }; 407 | name = Release; 408 | }; 409 | 331C80DD294CF71000263BE5 /* Profile */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | BUNDLE_LOADER = "$(TEST_HOST)"; 413 | CURRENT_PROJECT_VERSION = 1; 414 | GENERATE_INFOPLIST_FILE = YES; 415 | MARKETING_VERSION = 1.0; 416 | PRODUCT_BUNDLE_IDENTIFIER = com.raindead.flutterGamePhysics.RunnerTests; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | SWIFT_VERSION = 5.0; 419 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_game_physics.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_game_physics"; 420 | }; 421 | name = Profile; 422 | }; 423 | 338D0CE9231458BD00FA5F75 /* Profile */ = { 424 | isa = XCBuildConfiguration; 425 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 426 | buildSettings = { 427 | ALWAYS_SEARCH_USER_PATHS = NO; 428 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 429 | CLANG_ANALYZER_NONNULL = YES; 430 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 431 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 432 | CLANG_CXX_LIBRARY = "libc++"; 433 | CLANG_ENABLE_MODULES = YES; 434 | CLANG_ENABLE_OBJC_ARC = YES; 435 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 436 | CLANG_WARN_BOOL_CONVERSION = YES; 437 | CLANG_WARN_CONSTANT_CONVERSION = YES; 438 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 439 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 440 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 441 | CLANG_WARN_EMPTY_BODY = YES; 442 | CLANG_WARN_ENUM_CONVERSION = YES; 443 | CLANG_WARN_INFINITE_RECURSION = YES; 444 | CLANG_WARN_INT_CONVERSION = YES; 445 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 446 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 447 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 448 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 449 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 450 | CODE_SIGN_IDENTITY = "-"; 451 | COPY_PHASE_STRIP = NO; 452 | DEAD_CODE_STRIPPING = YES; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 457 | GCC_C_LANGUAGE_STANDARD = gnu11; 458 | GCC_NO_COMMON_BLOCKS = YES; 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | MACOSX_DEPLOYMENT_TARGET = 10.14; 465 | MTL_ENABLE_DEBUG_INFO = NO; 466 | SDKROOT = macosx; 467 | SWIFT_COMPILATION_MODE = wholemodule; 468 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 469 | }; 470 | name = Profile; 471 | }; 472 | 338D0CEA231458BD00FA5F75 /* Profile */ = { 473 | isa = XCBuildConfiguration; 474 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 475 | buildSettings = { 476 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 477 | CLANG_ENABLE_MODULES = YES; 478 | CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; 479 | CODE_SIGN_STYLE = Automatic; 480 | COMBINE_HIDPI_IMAGES = YES; 481 | INFOPLIST_FILE = Runner/Info.plist; 482 | LD_RUNPATH_SEARCH_PATHS = ( 483 | "$(inherited)", 484 | "@executable_path/../Frameworks", 485 | ); 486 | PROVISIONING_PROFILE_SPECIFIER = ""; 487 | SWIFT_VERSION = 5.0; 488 | }; 489 | name = Profile; 490 | }; 491 | 338D0CEB231458BD00FA5F75 /* Profile */ = { 492 | isa = XCBuildConfiguration; 493 | buildSettings = { 494 | CODE_SIGN_STYLE = Manual; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | }; 497 | name = Profile; 498 | }; 499 | 33CC10F92044A3C60003C045 /* Debug */ = { 500 | isa = XCBuildConfiguration; 501 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 502 | buildSettings = { 503 | ALWAYS_SEARCH_USER_PATHS = NO; 504 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 505 | CLANG_ANALYZER_NONNULL = YES; 506 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 507 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 508 | CLANG_CXX_LIBRARY = "libc++"; 509 | CLANG_ENABLE_MODULES = YES; 510 | CLANG_ENABLE_OBJC_ARC = YES; 511 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 512 | CLANG_WARN_BOOL_CONVERSION = YES; 513 | CLANG_WARN_CONSTANT_CONVERSION = YES; 514 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 515 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 516 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 517 | CLANG_WARN_EMPTY_BODY = YES; 518 | CLANG_WARN_ENUM_CONVERSION = YES; 519 | CLANG_WARN_INFINITE_RECURSION = YES; 520 | CLANG_WARN_INT_CONVERSION = YES; 521 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 522 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 523 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 524 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 525 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 526 | CODE_SIGN_IDENTITY = "-"; 527 | COPY_PHASE_STRIP = NO; 528 | DEAD_CODE_STRIPPING = YES; 529 | DEBUG_INFORMATION_FORMAT = dwarf; 530 | ENABLE_STRICT_OBJC_MSGSEND = YES; 531 | ENABLE_TESTABILITY = YES; 532 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 533 | GCC_C_LANGUAGE_STANDARD = gnu11; 534 | GCC_DYNAMIC_NO_PIC = NO; 535 | GCC_NO_COMMON_BLOCKS = YES; 536 | GCC_OPTIMIZATION_LEVEL = 0; 537 | GCC_PREPROCESSOR_DEFINITIONS = ( 538 | "DEBUG=1", 539 | "$(inherited)", 540 | ); 541 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 542 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 543 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 544 | GCC_WARN_UNUSED_FUNCTION = YES; 545 | GCC_WARN_UNUSED_VARIABLE = YES; 546 | MACOSX_DEPLOYMENT_TARGET = 10.14; 547 | MTL_ENABLE_DEBUG_INFO = YES; 548 | ONLY_ACTIVE_ARCH = YES; 549 | SDKROOT = macosx; 550 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 551 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 552 | }; 553 | name = Debug; 554 | }; 555 | 33CC10FA2044A3C60003C045 /* Release */ = { 556 | isa = XCBuildConfiguration; 557 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 558 | buildSettings = { 559 | ALWAYS_SEARCH_USER_PATHS = NO; 560 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 561 | CLANG_ANALYZER_NONNULL = YES; 562 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 563 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 564 | CLANG_CXX_LIBRARY = "libc++"; 565 | CLANG_ENABLE_MODULES = YES; 566 | CLANG_ENABLE_OBJC_ARC = YES; 567 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 568 | CLANG_WARN_BOOL_CONVERSION = YES; 569 | CLANG_WARN_CONSTANT_CONVERSION = YES; 570 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 571 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 572 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 573 | CLANG_WARN_EMPTY_BODY = YES; 574 | CLANG_WARN_ENUM_CONVERSION = YES; 575 | CLANG_WARN_INFINITE_RECURSION = YES; 576 | CLANG_WARN_INT_CONVERSION = YES; 577 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 578 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 579 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 580 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 581 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 582 | CODE_SIGN_IDENTITY = "-"; 583 | COPY_PHASE_STRIP = NO; 584 | DEAD_CODE_STRIPPING = YES; 585 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 586 | ENABLE_NS_ASSERTIONS = NO; 587 | ENABLE_STRICT_OBJC_MSGSEND = YES; 588 | ENABLE_USER_SCRIPT_SANDBOXING = NO; 589 | GCC_C_LANGUAGE_STANDARD = gnu11; 590 | GCC_NO_COMMON_BLOCKS = YES; 591 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 592 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 593 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 594 | GCC_WARN_UNUSED_FUNCTION = YES; 595 | GCC_WARN_UNUSED_VARIABLE = YES; 596 | MACOSX_DEPLOYMENT_TARGET = 10.14; 597 | MTL_ENABLE_DEBUG_INFO = NO; 598 | SDKROOT = macosx; 599 | SWIFT_COMPILATION_MODE = wholemodule; 600 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 601 | }; 602 | name = Release; 603 | }; 604 | 33CC10FC2044A3C60003C045 /* Debug */ = { 605 | isa = XCBuildConfiguration; 606 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 607 | buildSettings = { 608 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 609 | CLANG_ENABLE_MODULES = YES; 610 | CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; 611 | CODE_SIGN_STYLE = Automatic; 612 | COMBINE_HIDPI_IMAGES = YES; 613 | INFOPLIST_FILE = Runner/Info.plist; 614 | LD_RUNPATH_SEARCH_PATHS = ( 615 | "$(inherited)", 616 | "@executable_path/../Frameworks", 617 | ); 618 | PROVISIONING_PROFILE_SPECIFIER = ""; 619 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 620 | SWIFT_VERSION = 5.0; 621 | }; 622 | name = Debug; 623 | }; 624 | 33CC10FD2044A3C60003C045 /* Release */ = { 625 | isa = XCBuildConfiguration; 626 | baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; 627 | buildSettings = { 628 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 629 | CLANG_ENABLE_MODULES = YES; 630 | CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; 631 | CODE_SIGN_STYLE = Automatic; 632 | COMBINE_HIDPI_IMAGES = YES; 633 | INFOPLIST_FILE = Runner/Info.plist; 634 | LD_RUNPATH_SEARCH_PATHS = ( 635 | "$(inherited)", 636 | "@executable_path/../Frameworks", 637 | ); 638 | PROVISIONING_PROFILE_SPECIFIER = ""; 639 | SWIFT_VERSION = 5.0; 640 | }; 641 | name = Release; 642 | }; 643 | 33CC111C2044C6BA0003C045 /* Debug */ = { 644 | isa = XCBuildConfiguration; 645 | buildSettings = { 646 | CODE_SIGN_STYLE = Manual; 647 | PRODUCT_NAME = "$(TARGET_NAME)"; 648 | }; 649 | name = Debug; 650 | }; 651 | 33CC111D2044C6BA0003C045 /* Release */ = { 652 | isa = XCBuildConfiguration; 653 | buildSettings = { 654 | CODE_SIGN_STYLE = Automatic; 655 | PRODUCT_NAME = "$(TARGET_NAME)"; 656 | }; 657 | name = Release; 658 | }; 659 | /* End XCBuildConfiguration section */ 660 | 661 | /* Begin XCConfigurationList section */ 662 | 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { 663 | isa = XCConfigurationList; 664 | buildConfigurations = ( 665 | 331C80DB294CF71000263BE5 /* Debug */, 666 | 331C80DC294CF71000263BE5 /* Release */, 667 | 331C80DD294CF71000263BE5 /* Profile */, 668 | ); 669 | defaultConfigurationIsVisible = 0; 670 | defaultConfigurationName = Release; 671 | }; 672 | 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { 673 | isa = XCConfigurationList; 674 | buildConfigurations = ( 675 | 33CC10F92044A3C60003C045 /* Debug */, 676 | 33CC10FA2044A3C60003C045 /* Release */, 677 | 338D0CE9231458BD00FA5F75 /* Profile */, 678 | ); 679 | defaultConfigurationIsVisible = 0; 680 | defaultConfigurationName = Release; 681 | }; 682 | 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { 683 | isa = XCConfigurationList; 684 | buildConfigurations = ( 685 | 33CC10FC2044A3C60003C045 /* Debug */, 686 | 33CC10FD2044A3C60003C045 /* Release */, 687 | 338D0CEA231458BD00FA5F75 /* Profile */, 688 | ); 689 | defaultConfigurationIsVisible = 0; 690 | defaultConfigurationName = Release; 691 | }; 692 | 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { 693 | isa = XCConfigurationList; 694 | buildConfigurations = ( 695 | 33CC111C2044C6BA0003C045 /* Debug */, 696 | 33CC111D2044C6BA0003C045 /* Release */, 697 | 338D0CEB231458BD00FA5F75 /* Profile */, 698 | ); 699 | defaultConfigurationIsVisible = 0; 700 | defaultConfigurationName = Release; 701 | }; 702 | /* End XCConfigurationList section */ 703 | }; 704 | rootObject = 33CC10E52044A3C60003C045 /* Project object */; 705 | } 706 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_game_physics 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.raindead.flutterGamePhysics 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.raindead. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.18.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_lints: 58 | dependency: "direct dev" 59 | description: 60 | name: flutter_lints 61 | sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c" 62 | url: "https://pub.dev" 63 | source: hosted 64 | version: "4.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | leak_tracker: 71 | dependency: transitive 72 | description: 73 | name: leak_tracker 74 | sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "10.0.5" 78 | leak_tracker_flutter_testing: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker_flutter_testing 82 | sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "3.0.5" 86 | leak_tracker_testing: 87 | dependency: transitive 88 | description: 89 | name: leak_tracker_testing 90 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "3.0.1" 94 | lints: 95 | dependency: transitive 96 | description: 97 | name: lints 98 | sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235" 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "4.0.0" 102 | matcher: 103 | dependency: transitive 104 | description: 105 | name: matcher 106 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "0.12.16+1" 110 | material_color_utilities: 111 | dependency: transitive 112 | description: 113 | name: material_color_utilities 114 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "0.11.1" 118 | meta: 119 | dependency: transitive 120 | description: 121 | name: meta 122 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 123 | url: "https://pub.dev" 124 | source: hosted 125 | version: "1.15.0" 126 | path: 127 | dependency: transitive 128 | description: 129 | name: path 130 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 131 | url: "https://pub.dev" 132 | source: hosted 133 | version: "1.9.0" 134 | sky_engine: 135 | dependency: transitive 136 | description: flutter 137 | source: sdk 138 | version: "0.0.99" 139 | source_span: 140 | dependency: transitive 141 | description: 142 | name: source_span 143 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "1.10.0" 147 | stack_trace: 148 | dependency: transitive 149 | description: 150 | name: stack_trace 151 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "1.11.1" 155 | stream_channel: 156 | dependency: transitive 157 | description: 158 | name: stream_channel 159 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "2.1.2" 163 | string_scanner: 164 | dependency: transitive 165 | description: 166 | name: string_scanner 167 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "1.2.0" 171 | term_glyph: 172 | dependency: transitive 173 | description: 174 | name: term_glyph 175 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "1.2.1" 179 | test_api: 180 | dependency: transitive 181 | description: 182 | name: test_api 183 | sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "0.7.2" 187 | vector_math: 188 | dependency: "direct main" 189 | description: 190 | name: vector_math 191 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "2.1.4" 195 | vm_service: 196 | dependency: transitive 197 | description: 198 | name: vm_service 199 | sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" 200 | url: "https://pub.dev" 201 | source: hosted 202 | version: "14.2.5" 203 | sdks: 204 | dart: ">=3.5.4 <4.0.0" 205 | flutter: ">=3.18.0-18.0.pre.54" 206 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_game_physics 2 | description: "A Flutter sample showing the basics of physics." 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | 5 | version: 0.0.0+1 6 | 7 | environment: 8 | sdk: ^3.5.4 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | vector_math: ^2.1.4 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | flutter_lints: ^4.0.0 20 | 21 | flutter: 22 | uses-material-design: true 23 | 24 | assets: 25 | - assets/cannon ball_2.png 26 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/filiph/flutter_game_physics/133b33379c40b300850819c3057271742a85e259/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | flutter_game_physics 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_game_physics", 3 | "short_name": "flutter_game_physics", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A Flutter sample showing the basics of physics.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | --------------------------------------------------------------------------------