Questions tagged [flame]

Flame is a modular game engine built with Flutter.

Flame is a 2D game engine built on top of the Flutter framework, composed of a ever expanding set of modular solutions that developers can pick and choose to make from simple to very complex games on Android, iOS and now web/desktop (beta).

281 questions
0
votes
1 answer

how to make a blue translucent overlay on the square by flame lib

I want to create a word search game. I'm working on a flame library to do that. I am having a problem how can I make a blue translucent overlay on the square. I tried: class Box2 extends PositionComponent { static const speed = 0.25; static…
0
votes
1 answer

NoSuchMethodError: invalid member on null: 'findAncestorStateOfType'

I am still fairly new to flutter and flame but I am working on a game where I need to able to pass BuilerContext context inside of a class that extends BaseGame, I am currently using a method that adds a component that is a widget to the screen…
0
votes
1 answer

Change to a subtype of 'Widget'. Future build(BuildContext context) async {

I am still pretty new to flutter and dart but I am currently trying to return a future widget that is my main game inside of a StatefulWidget and I am wondering if I need to use a future builder or if there is another way to do it? import…
0
votes
1 answer

(TiledWorldMap) Error: Expected a value of type 'double?', but got one of type 'String'

I am still pretty new to flame, flutter, and dart overall but I am trying to display a tiled world map using the Bonfire plugin which sits on top of flame but whenever I try to run the program it tells me that the value stored in 'TildWorldMap' is…
0
votes
1 answer

Two questions about Flame Engine

I have some questions. I'm working over app which uses Flame Engine in Expanded Widget as a part of bigger application. So Flame is used only as graphic representation of buttons and for interaction. Now, theoretically: Is it possible to send…
Newman
  • 29
  • 4
0
votes
1 answer

How to use sensor to moving object in forge2d

I want to make a game using sensor to moving component how can i achieve that? The effect something like that https://youtu.be/sFZ-IvlVTTw
Definev
  • 21
  • 1
  • 2
0
votes
1 answer

Flame Error: Cannot run with sound null safety

After installing flame and when i run my app in flutter (flutter run). I got a long error regarding null safety: Running Gradle task 'assembleDebug'... Error: Cannot run with sound null safety, because the following dependencies don't support null…
0
votes
2 answers

error: Non-nullable instance field 'screenSize' must be initialized

I am pretty new to flame and flutter but I was just trying to set up the basis for a game project I am working on and it is telling me that the field "screenSize", as well as "tileSize", must be initialized. import 'dart:ui'; import…
Cameron Johnson
  • 143
  • 1
  • 10
0
votes
1 answer

Two dots in dart (..)

I was reading the example game code in the Flame game engine. Code: MyGame() { add(Square() ..x = 100 ..y = 100); } this was the code in the repository (line 59-63):…
An Android
  • 149
  • 1
  • 6
0
votes
2 answers

Adding background in flutter

What should I do to apply my background image in my project? Did I miss something? My background image found under lib/assets/background.jpg void main() async { WidgetsFlutterBinding.ensureInitialized(); Util flameUtil = Util(); await…
user15115251
0
votes
1 answer

flutter flame not found FrameTiming

i create empty flutter application and add dependency flame. After assembly i get an Error ../../../../.pub-cache/hosted/pub.dartlang.org/flame-0.28.0/lib/fps_counter.dart:10:8: Error: Type 'FrameTiming' not found. List
litehause
  • 303
  • 5
  • 12
0
votes
1 answer

How to add ads in flutter flame

Like we have sprite to add/render images in flutter flame. Is their any widget or any way to show ads(admob) in flutter flame project.
lonewolf
  • 61
  • 6
0
votes
1 answer

How do I make a child widget expand to fill a parent container inside of a stack when the child has no parameters to alter its layout?

I'm building a card game and using flame to pull the cards from a sprite sheet. The problem is that I set the width and height of the Container that holds the SpriteWidget, but the SpriteWidget expands to either the width or the height of the…
lotrgollum87
  • 320
  • 3
  • 7
0
votes
1 answer

flame_tiled and/or tiled package gives error when running on web

Using flame_tiled plugin to load a tiled map. Loading a map through the TiledComponent like so: tiledComponent = TiledComponent("new4.tmx", Size(32.0,32.0)); add(tiledComponent); This works well on a mobile.However, when using flutter for web…
user1261913
  • 325
  • 4
  • 18
0
votes
1 answer

When i try to load base64 image using flame engine at that time i got below error. i used flame: ^0.27.0

when I used aync await method at that time it works properly but when i try to load image in flame's component class I got error: I have created a Background class that extends flame engine's component class. Now I am tring to load a base64 image…
1 2 3
18
19