Code Monkey home page Code Monkey logo

flutter-galaxy-game's Introduction

Galaxy: A 2D game in Flutter using the Flame Engine

A new Flutter project.

Game demo

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

flutter-galaxy-game's People

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  avatar  avatar  avatar

flutter-galaxy-game's Issues

Dragging on the screen breaks placement of bullets

Tapping to place a bullet works fine. Although dragging on the screen breaks something which then breaks the placement of bullets even with tapping.

I temporarily fixed it by commenting out

  HorizontalDragGestureRecognizer horizontalDragGestureRecognizer =
      new HorizontalDragGestureRecognizer();

  Flame.util.addGestureRecognizer(horizontalDragGestureRecognizer
    ..onUpdate = (startDetails) => game.dragInput(startDetails.globalPosition));

in main.dart.

Although, out of curiosity - I'd wanna find out why it breaks?

I'm running it on a Pixel 1 via USB Debugging.

Unhandled Exception thrown

Performing hot restart...
Restarted application in 1,239ms.
[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
If you're running an application and need to access the binary messenger before runApp() has been called (for example, during plugin initialization), then you need to explicitly call the WidgetsFlutterBinding.ensureInitialized() first.
If you're running a test, you can call the TestWidgetsFlutterBinding.ensureInitialized() as the first line in your test's main() method to initialize the binding.

ConcurrentModificationError was thrown during a scheduler callback:

flutter: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following ConcurrentModificationError was thrown during a scheduler callback:
flutter: Concurrent modification during iteration: Instance(length:29) of '_GrowableList'.
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 List.forEach (dart:core-patch/growable_array.dart:286:36)
flutter: #1 Bullet.update (package:galaxygame/bullet.dart:21:18)
flutter: #2 BaseGame.update. (package:flame/game.dart:228:33)
flutter: #3 IterableMixin.forEach (dart:collection/iterable.dart:46:30)
flutter: #4 BaseGame.update (package:flame/game.dart:228:16)
flutter: #5 Galaxy.update (package:galaxygame/galaxy.dart:50:11)
flutter: #6 _GameRenderBox._update (package:flame/game.dart:124:10)
flutter: #7 _GameRenderBox._tick (package:flame/game.dart:117:5)
flutter: #8 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
flutter: #9 SchedulerBinding.handleBeginFrame. (package:flutter/src/scheduler/binding.dart:1017:11)
flutter: #10 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
flutter: #11 SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:1015:17)
flutter: #12 SchedulerBinding._handleBeginFrame (package:flutter/src/scheduler/binding.dart:949:5)
flutter: #16 _invoke1 (dart:ui/hooks.dart:273:10)
flutter: #17 _beginFrame (dart:ui/hooks.dart:200:3)
flutter: (elided 3 frames from package dart:async)

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.