Giter Site home page Giter Site logo

g0rdan / flutter.bird Goto Github PK

View Code? Open in Web Editor NEW
132.0 3.0 38.0 2.59 MB

Clone of Flappy Bird game on Flutter.

Java 1.12% Objective-C 2.30% Dart 75.68% Ruby 6.74% Shell 14.17%
flutter flutter-apps flutter-examples flutter-demo flame flames-game dart dartlang dart2 flappy-bird flappybird flappy-bird-game

flutter.bird's Introduction

The repository is not supported anymore and there won't be any updates.

flutter_bird

Clone of Flappy Bird game written on Flutter.

an example

Intro

This is silly attempt to learn the new mobile framework.

If you remember, there was a game called Flappy Bird. At that time it was a best time killer app. I was a fan back in days. Anyway, it is not a full clone of the game. It's just repeating some basic mechanics and graphics.

The game has built on Flutter and Flame game engine.

I haven't tried many features from standart library like Streams or even Net stack. So, I can't fully compare an experience with other languages and frameworks. Anyway, I'm looking forward to use more features in my next apps!

Pros:

  • Dart. I didn't expect that Dart language is so easy to learn. The team did a good job for designing language. It feels like something in the middle between C# and Java, at least for me. I'm sure many others will find similarities with major languages like C-family in general, Javascript or Python. Keep in mind, it's not a coincidence. I bet, it was decided on purpose for making switch from one language to another as easy as possible. Again, good job.

  • Hot Reload! It's been the main feature for selling me that framework. I have to mention that I came from Xamarin background and in this universe it's a major issue. It could take 3 - 4 min after changing some color in xamarin app. You can't be productive in these circumstances. I know, Xamarin guys have made a lot of impowements, especially Xamarin.Android team. Thank you for that.

  • CLI. I have been using VSCode for Flutter and I have to admit, using CLI for interacting with the framework was a pleasure. You clearly see what you're doing and what to expect.

  • UI. Many devs already said it and I'll repeat, working with UI in Flutter is awesome! You don't lean on Web based rendering (Hybrid platforms) and don't have a mess with native rendering (Xamarin, React.Native). You have just your own rendering stack, from UI elements to low-level GPU render. It this case it's very fast compare to hybrid platforms and you don't have any direct dependencies on platform SDKs and APIs (for rendering UI).

Cons:

I can't find any big issues with this framework... It's solid, has a great community and growing faster then others. Maybe one thing. Like I said, I haven't touch many parts of framework but, as far as I know, there is some issues with interop to native APIs. But I'm sure community will find out some cure for that.

PS: It's my first "game", so, don't judge me. I've made a lot of mistakes in architecture and code.

flutter.bird's People

Contributors

g0rdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter.bird's Issues

Running well but one exception keep showing..

Any idea?

════════ Exception caught by scheduler library ═════════════════════════════════
The following assertion was thrown during a scheduler callback:
Failed assertion: boolean expression must not be null

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack
#0 Animation.update
package:flame/animation.dart:149
#1 AnimationComponent.update
package:flame/components/animation_component.dart:49
#2 BirdGround.update
package:flutter_bird/game/bird.dart:115
#3 Bird.update
package:flutter_bird/game/bird.dart:81
#4 FlutterBirdGame.update
package:flutter_bird/game/game.dart:83
...

This exception was thrown in the context of a scheduler callback. When the scheduler callback was registered (as opposed to when the exception was thrown), this was the stack
#0 new _FrameCallbackEntry.
package:flutter/…/scheduler/binding.dart:112
#1 new _FrameCallbackEntry
package:flutter/…/scheduler/binding.dart:115
#2 SchedulerBinding.scheduleFrameCallback
package:flutter/…/scheduler/binding.dart:459
#3 _GameRenderBox._scheduleTick
package:flame/game.dart:108
#4 _GameRenderBox._tick
package:flame/game.dart:117
...
════════════════════════════════════════════════════════════════════════════════

Can't run after pulling code

Environment configuration of my computer:
Flutter 2.2.2
Dart 2.13.3

An error is reported after executing the "flutter run":

xxx@xxxMBP Flutter.Bird % flutter run
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Using hardware rendering with device Android SDK built for x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY .
../../.pub-cache/hosted/pub.dartlang.org/flame-0.15.2/lib/flame.dart:62:7: Error: The non-abstract class 'FlameBiding' is missing implementations for these members:
 - SchedulerBinding.addPersistentFrameCallback                          
 - SchedulerBinding.addPostFrameCallback                                
 - SchedulerBinding.addTimingsCallback                                  
 - SchedulerBinding.cancelFrameCallbackWithId                           
 - SchedulerBinding.currentFrameTimeStamp                               
 - SchedulerBinding.currentSystemFrameTimeStamp                         
 - SchedulerBinding.debugAssertNoTransientCallbacks                     
 - SchedulerBinding.endOfFrame                                          
 - SchedulerBinding.ensureFrameCallbacksRegistered                      
 - SchedulerBinding.ensureVisualUpdate                                  
 - SchedulerBinding.framesEnabled                                       
 - SchedulerBinding.handleAppLifecycleStateChanged                      
 - SchedulerBinding.handleBeginFrame                                    
 - SchedulerBinding.handleDrawFrame                                     
 - SchedulerBinding.handleEventLoopCallback                             
 - SchedulerBinding.hasScheduledFrame                                   
 - SchedulerBinding.lifecycleState                                      
 - SchedulerBinding.removeTimingsCallback                               
 - SchedulerBinding.resetEpoch                                          
 - SchedulerBinding.scheduleForcedFrame                                 
 - SchedulerBinding.scheduleFrame                                       
 - SchedulerBinding.scheduleFrameCallback                               
 - SchedulerBinding.scheduleTask                                        
 - SchedulerBinding.scheduleWarmUpFrame                                 
 - SchedulerBinding.schedulerPhase                                      
 - SchedulerBinding.schedulingStrategy                                  
 - SchedulerBinding.transientCallbackCount                              
Try to either                                                           
 - provide an implementation,                                           
 - inherit an implementation from a superclass or mixin,                
 - mark the class as abstract, or                                       
 - provide a 'noSuchMethod' implementation.                             
                                                                        
class FlameBiding extends BindingBase with GestureBinding, ServicesBinding {
      ^^^^^^^^^^^                                                       
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:647:8: Context: 'SchedulerBinding.addPersistentFrameCallback' is defined here.
  void addPersistentFrameCallback(FrameCallback callback) {             
       ^^^^^^^^^^^^^^^^^^^^^^^^^^                                       
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:673:8: Context: 'SchedulerBinding.addPostFrameCallback' is defined here.
  void addPostFrameCallback(FrameCallback callback) {                   
       ^^^^^^^^^^^^^^^^^^^^                                             
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:265:8: Context: 'SchedulerBinding.addTimingsCallback' is defined here.
  void addTimingsCallback(TimingsCallback callback) {                   
       ^^^^^^^^^^^^^^^^^^                                               
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:534:8: Context: 'SchedulerBinding.cancelFrameCallbackWithId' is defined here.
  void cancelFrameCallbackWithId(int id) {                              
       ^^^^^^^^^^^^^^^^^^^^^^^^^                                        
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:932:16: Context: 'SchedulerBinding.currentFrameTimeStamp' is defined here.
  Duration get currentFrameTimeStamp {                                  
               ^^^^^^^^^^^^^^^^^^^^^                                    
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:950:16: Context: 'SchedulerBinding.currentSystemFrameTimeStamp' is defined here.
  Duration get currentSystemFrameTimeStamp {                            
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^                              
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:560:8: Context: 'SchedulerBinding.debugAssertNoTransientCallbacks' is defined here.
  bool debugAssertNoTransientCallbacks(String reason) {                 
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                  
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:688:20: Context: 'SchedulerBinding.endOfFrame' is defined here.
  Future<void> get endOfFrame {                                         
                   ^^^^^^^^^^                                           
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:726:8: Context: 'SchedulerBinding.ensureFrameCallbacksRegistered' is defined here.
  void ensureFrameCallbacksRegistered() {                               
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                   
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:744:8: Context: 'SchedulerBinding.ensureVisualUpdate' is defined here.
  void ensureVisualUpdate() {                                           
       ^^^^^^^^^^^^^^^^^^                                               
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:712:12: Context: 'SchedulerBinding.framesEnabled' is defined here.
  bool get framesEnabled => _framesEnabled;                             
           ^^^^^^^^^^^^^                                                
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:351:8: Context: 'SchedulerBinding.handleAppLifecycleStateChanged' is defined here.
  void handleAppLifecycleStateChanged(AppLifecycleState state) {        
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                   
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:1024:8: Context: 'SchedulerBinding.handleBeginFrame' is defined here.
  void handleBeginFrame(Duration? rawTimeStamp) {                       
       ^^^^^^^^^^^^^^^^                                                 
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:1075:8: Context: 'SchedulerBinding.handleDrawFrame' is defined here.
  void handleDrawFrame() {                                              
       ^^^^^^^^^^^^^^^                                                  
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:453:8: Context: 'SchedulerBinding.handleEventLoopCallback' is defined here.
  bool handleEventLoopCallback() {                                      
       ^^^^^^^^^^^^^^^^^^^^^^^                                          
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:702:12: Context: 'SchedulerBinding.hasScheduledFrame' is defined here.
  bool get hasScheduledFrame => _hasScheduledFrame;                     
           ^^^^^^^^^^^^^^^^^                                            
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:340:26: Context: 'SchedulerBinding.lifecycleState' is defined here.
  AppLifecycleState? get lifecycleState => _lifecycleState;             
                         ^^^^^^^^^^^^^^                                 
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:275:8: Context: 'SchedulerBinding.removeTimingsCallback' is defined here.
  void removeTimingsCallback(TimingsCallback callback) {                
       ^^^^^^^^^^^^^^^^^^^^^                                            
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:909:8: Context: 'SchedulerBinding.resetEpoch' is defined here.
  void resetEpoch() {                                                   
       ^^^^^^^^^^                                                       
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:817:8: Context: 'SchedulerBinding.scheduleForcedFrame' is defined here.
  void scheduleForcedFrame() {                                          
       ^^^^^^^^^^^^^^^^^^^                                              
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:784:8: Context: 'SchedulerBinding.scheduleFrame' is defined here.
  void scheduleFrame() {                                                
       ^^^^^^^^^^^^^                                                    
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:520:7: Context: 'SchedulerBinding.scheduleFrameCallback' is defined here.
  int scheduleFrameCallback(FrameCallback callback, { bool rescheduling = false }) {
      ^^^^^^^^^^^^^^^^^^^^^                                             
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:395:13: Context: 'SchedulerBinding.scheduleTask' is defined here.
  Future<T> scheduleTask<T>(                                            
            ^^^^^^^^^^^^                                                
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:851:8: Context: 'SchedulerBinding.scheduleWarmUpFrame' is defined here.
  void scheduleWarmUpFrame() {                                          
       ^^^^^^^^^^^^^^^^^^^                                              
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:706:22: Context: 'SchedulerBinding.schedulerPhase' is defined here.
  SchedulerPhase get schedulerPhase => _schedulerPhase;                 
                     ^^^^^^^^^^^^^^                                     
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:369:22: Context: 'SchedulerBinding.schedulingStrategy' is defined here.
  SchedulingStrategy schedulingStrategy = defaultSchedulingStrategy;    
                     ^^^^^^^^^^^^^^^^^^                                 
../../flutter/packages/flutter/lib/src/scheduler/binding.dart:499:11: Context: 'SchedulerBinding.transientCallbackCount' is defined here.
  int get transientCallbackCount => _transientCallbacks.length;         
          ^^^^^^^^^^^^^^^^^^^^^^                                        
../../.pub-cache/hosted/pub.dartlang.org/flame-0.15.2/lib/flame.dart:62:7: Error: '_FlameBiding&BindingBase&GestureBinding' doesn't implement 'SchedulerBinding' so it can't be used with 'ServicesBinding'.
 - 'BindingBase with GestureBinding' is from 'package:flame/flame.dart' ('../../.pub-cache/hosted/pub.dartlang.org/flame-0.15.2/lib/flame.dart').
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
 - 'ServicesBinding' is from 'package:flutter/src/services/binding.dart' ('../../flutter/packages/flutter/lib/src/services/binding.dart').
class FlameBiding extends BindingBase with GestureBinding, ServicesBinding {
      ^                                                                 
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_provider.dart:49:45: Error: No named parameter with the name 'nullOk'.
    locale: Localizations.localeOf(context, nullOk: true),              
                                            ^^^^^^                      
../../flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
  static Locale localeOf(BuildContext context) {                        
                ^^^^^^^^                                                
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:92:3: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
  PictureStream();                                                      
  ^^^^^^^^^^^^^                                                         
../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.14.4/lib/src/picture_stream.dart:192:16: Error: The superclass, 'Diagnosticable', has no unnamed constructor that takes no arguments.
abstract class PictureStreamCompleter extends Diagnosticable {          
               ^                                                        
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script '/Users/xxx/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1035
                                                                        
* What went wrong:                                                      
Execution failed for task ':app:compileFlutterBuildDebug'.              
> Process 'command '/Users/xxx/flutter/bin/flutter'' finished with non-zero exit value 1
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 13s                                                     
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        14.7s
Exception: Gradle task assembleDebug failed with exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.