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
3
votes
3 answers

How to detect a swipe in a game with flutter/flame

I want to create a game in flutter with flame. For this game I want to detect swipes. I could implement a tap recognition with the help of a tutorial. But I could not implement it with swipe detection. my main with Taprecognition looks like this: My…
ChrizZlyBear
  • 121
  • 2
  • 11
3
votes
1 answer

How to implement a drag and tap at same time

I'm making a flutter game with Flame and i have a problem implementing the controllers. The controllers are basically a joystick and a button atack. To the joystick i need the panStart, panUpdate and panEnd gestures, and to the attack button onTapUp…
3
votes
1 answer

How can I replace Flutter widgets with canvas and vice versa?

I'm making a 2D game using Flutter Flame. The library uses a canvas, as seen here: start() { var previous = Duration.ZERO; window.onBeginFrame = (now) { var recorder = new PictureRecorder(); var canvas = new Canvas( recorder, …
Jellio
  • 1,331
  • 2
  • 9
  • 15
2
votes
1 answer

flutter flame camera shake deprecated

When I tried to repeat some lecture of flutter flame, most of youtube instructors teach me this way to shake screen. But IDE complaint using camera property directly was deprecated. So, What is best way to shake camera (or viewport or world) now…
김종현
  • 33
  • 1
  • 3
2
votes
2 answers

Flutter Flame OS Error: "The process cannot access the file because it is being used by another process " when using audio file .wav

Hi I'am buiding a game and I loaded the required .wav files to be played when the player colloid with an obstacle : FlameAudio.play("file.wav") But when I restart the app in debug mode it gives me an error: OS Error: FileSystemException…
aym1781969
  • 545
  • 1
  • 4
  • 16
2
votes
2 answers

How to loop background audio without gap?

The app plays some background audio (wav) in an endless loop. Audio playback was flawless using just_audio package, but after switching to audioplayers, all looped audio now contain a short gap of silence before they restart at the beginning.…
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
2
votes
1 answer

Navigate to a flutter widget from a flame game without losing the game state

My flame game concept is that a player moves, and when the player collides with a star object, a pop up flutter window contains a question shall appear, and when the user closes it, the game state and player position will be restored.How can I do…
Sarah
  • 23
  • 5
2
votes
1 answer

Shooting bullets in Flame Forge2d

I'm playing around with Forge2d on Flutter Flame and created a Ninja which throws Kanuies (a character shooting bullets basically). If I create Kanuies and the Ninja separately then add them separately to the game world, all will be fine. However, I…
Mahdi Amini
  • 402
  • 1
  • 3
  • 17
2
votes
0 answers

Flutter Flame FlameAudio: No sound on android phone

Below is a very simple piece of code. I'm using the default code provided with "new flutter project". Sound will play under Windows, but not under Android. I don't know where to look anymore....please help Added 2 lines to main.dart: import…
jrh
  • 25
  • 4
2
votes
1 answer

How to render DistanceJoint

I need to render a DistanceJoint, just a line connecting the 2 anchors, nothing fancy. I've seen something about a render method here but I coulen't figure out how to use it. I also don't mind using debug features. Thank you very much :)
Adam Katav
  • 328
  • 3
  • 13
2
votes
1 answer

Detect tap on PositionComponent with FixedResolutionViewport

When using a FixedResolutionViewport the tap event on a PositionComponent is relative to the screen size and not to the resized viewport as expected. If I remove FixedResolutionViewport the tap is registered correctly. Am I missing something? What…
Lucia Maj
  • 43
  • 1
  • 5
2
votes
0 answers

Vector2 bouncing off ScreenHitbox and other CircleHitbox

This question could be asked to any math wizard, but I am playing around in flame( loads of fun ), so I allow myself to ask it here. My math is rusty but I have tried using reflect and normalized, but I am way off here. Can you help, and maybe give…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
2
votes
1 answer

Flutter Flame: how to use parallax with camera.followComponent?

Using Flutter Flame I'm trying to create a parallax background for a side scrolling game, where the camera focuses on the hero. I've only found examples of a constant speed scrolling parallax, but not one that respects the camera movement in the…
András Szepesházi
  • 6,483
  • 5
  • 45
  • 59
2
votes
1 answer

How to recolour a Sprite

I am trying to figure out how to recolour or 'tint' a Sprite using the Flame engine for Flutter. I've tried to add or override a Paint object as described here: How to Add transparency to image. Using the code below I tried changing the Paint object…
denniswave
  • 127
  • 6
2
votes
1 answer

Can flame components (flutter flame) be widgets within a Flutter app?

Can flutter flame (https://flame-engine.org/) be used to create a "flame widget" which can be used within a Flutter app? (i.e. as opposed to having a full flame game, for which you might do flutter widget overlays) For example say you had a…
Greg
  • 34,042
  • 79
  • 253
  • 454
1
2
3
18 19