Some fixes regarding the joystic PR

This commit is contained in:
Erick Zanardo
2020-06-30 22:30:05 -03:00
parent feca051911
commit 277faacf8f
3 changed files with 46 additions and 2 deletions

44
doc/examples/joystick/.gitignore vendored Normal file
View File

@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

View File

@ -12,7 +12,7 @@ class Player extends Component implements JoystickListener {
final _greenPaint = Paint()..color = const Color(0xFF00FF00);
final double speed = 159;
double currentSpeed = 0;
double radAngle;
double radAngle = 0;
bool _move = false;
Paint _paint;

View File

@ -72,7 +72,7 @@ class JoystickDirectional {
Offset(margin.left, _screenSize.height - margin.bottom);
_backgroundRect = Rect.fromCircle(center: osBackground, radius: size / 2);
Offset osKnob =
final Offset osKnob =
Offset(_backgroundRect.center.dx, _backgroundRect.center.dy);
_knobRect = Rect.fromCircle(center: osKnob, radius: size / 4);