Create an Amazing Game with Flutter & Flame

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มิ.ย. 2023
  • 📺 Checkout the playlist - • Create an Amazing Game...
    📂 Checkout the GitHub project - github.com/Spellthorn/pixel_a...
    🖼️ Game Assets - pixelfrog-assets.itch.io/pixe...
    💻 Tiled - www.mapeditor.org/
    Welcome to this comprehensive tutorial on building your own game using Flutter and Flame! In this video, we'll guide you through the process of creating a captivating game from scratch, utilizing the power of Flutter's UI framework and Flame's game engine.
    Whether you're a beginner or an experienced developer looking to explore game development, this tutorial is perfect for you. We'll start by introducing Flutter and Flame, highlighting their capabilities and how they work together to create dynamic and interactive games.
    Throughout this step-by-step tutorial, we'll cover the essential aspects of game development, including game loops, rendering graphics, handling user input, and managing game states. You'll learn how to create engaging animations, implement collision detection, and incorporate sound effects to enhance your game's overall experience.
    To ensure your success, we'll provide clear explanations and demonstrations of each code snippet and concept along the way. By the end of this tutorial, you'll have a fully functional game built with Flutter and Flame, ready to be deployed on multiple platforms, including Android, iOS, and web.
    Whether you're interested in building casual games, puzzle games, or even more complex genres, this tutorial will equip you with the knowledge and skills to turn your ideas into reality. Get ready to unleash your creativity and join the exciting world of game development with Flutter and Flame!
    Don't forget to like the video, subscribe to our channel for more exciting tutorials, and share your thoughts and questions in the comments section below. Let's dive into the world of game development together!
    🛡️Join this channel to get access to perks: www.youtube.com/@Spellthorn/join
    Help me reach my sub goal by subscribing youtube.com/@Spellthorn?sub_c...
    ||||||||||||||| 233% ||||||||||||||| 4.66K/2K
    Most recent subscriber: Tobias Flores
    @Spellthorn is a talented web/mobile developer who is dedicated to helping others improve their coding skills. Through their TH-cam channel, they create informative and engaging videos that cover a wide range of programming topics. - spellthorn.com/
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 111

  • @LukasKlingsbo
    @LukasKlingsbo 5 หลายเดือนก่อน +21

    A reminder to everyone that is doing this tutorial now, there is no need to create a separate `CameraComponent` anymore (called `cam` in here), since there already is one included by default on `FlameGame`. :)

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน +1

      Great update, thanks

    • @user-oe9bh7fz3e
      @user-oe9bh7fz3e 4 หลายเดือนก่อน

      bro is it working ?,i am asking this coz recently flutter got updated right

  • @blakefarnsworth
    @blakefarnsworth ปีที่แล้ว +20

    This was fantastic! I'm just starting to learn Dart/Flutter and game design, so I'm excited to see this playlist as it progresses!

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว +4

      I'm glad you're enjoying it. Flutter is a lot of fun, I'm still trying to figure out everything with flame myself. 😁

  • @crazybazy7938
    @crazybazy7938 10 หลายเดือนก่อน +5

    The best tutorial on developing games with flutter. Iam excited for the next videos in the playlist. Definitely deserved like and sub :)

    • @Spellthorn
      @Spellthorn  9 หลายเดือนก่อน +1

      Glad you liked it! 😁

  • @GoGoJoeShow
    @GoGoJoeShow 5 หลายเดือนก่อน +2

    This is well explained and just what I was looking for. Getting back into Game design after years. Thanks Spellthorn!

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Glad I could help!

  • @karansayata7447
    @karansayata7447 ปีที่แล้ว +4

    Fantastic. Looking forward to the rest of the series. Thanks for the tutorials.

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว

      Glad you like them! I'm excited to make it a game 😁

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว

      Episode 2 is live now 😁

  • @crazyvolt1660
    @crazyvolt1660 10 หลายเดือนก่อน +6

    Almost 6 months ago, I learned mobile app development using Flutter,
    After that I searched for game development using Flutter, but didn't get any Tutorial.
    But few days ago, I found this Awesome Tutorial and this Tutor is amazing
    Have complete knowledge of what he is doing.
    Im exciting to continue in this journey.
    Thank you, Sir

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน +3

      You're welcome. I also struggled with this for about a month which is why I wanted to make the tutorial, I'm glad its helping 😊

  • @egehandastan9513
    @egehandastan9513 7 หลายเดือนก่อน

    Thank you for this amazing tutorial. You have a lot of contributions on me. This is awesome!

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      I'm glad you enjoyed it 😊

  • @user-ws7ho9lr6d
    @user-ws7ho9lr6d 11 หลายเดือนก่อน +15

    If the autocomplete isn't working, you can press 'Ctrl+ Space'. Doing so will give you the suggestions if avaliable. The tutorial is very nice though.

    • @Spellthorn
      @Spellthorn  11 หลายเดือนก่อน +1

      Thanks for the tip! Glad you enjoyed it 😁

  • @talhasezer4
    @talhasezer4 11 หลายเดือนก่อน

    This is a very nice tutorial and explanation. I am excited to finish the tutorial and do something fun.

    • @Spellthorn
      @Spellthorn  11 หลายเดือนก่อน +1

      I'm glad you're enjoying it. I've made a lot of progress videos so far to help you, next one comes out tomorrow morning 😀

  • @haseebkahn4811
    @haseebkahn4811 3 หลายเดือนก่อน

    you offered me massive help. Thanks dude!

    • @Spellthorn
      @Spellthorn  3 หลายเดือนก่อน

      Glad I could help!

  • @zianjohnillustrisimo9375
    @zianjohnillustrisimo9375 6 หลายเดือนก่อน +1

    I really love this tutorial. I'm quite new to flutter as I was originally a Javascript developer, but I wanted a different programming language mainly for games as Javascript sometimes doesn't work properly.

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Personally I feel JavaScript has its benefits of Flame but still is fun

  • @tacowaco
    @tacowaco ปีที่แล้ว +7

    Great topic and so well explained! Looking forward to the rest of this series.

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว +2

      Glad you enjoyed it! Yea game development is quite fun when you know what you're doing. It definitely took me awhile to understand it but now its starting to click 😁 so wanted to help others since there weren't many tutorials and some of them confused me more lol

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว

      Episode 2 is live now 😁

  • @jazzycoder
    @jazzycoder 7 หลายเดือนก่อน +1

    Brilliant tutorial!

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Thanks 😊

  • @Zartindev
    @Zartindev 5 หลายเดือนก่อน

    thanks bro amazing tutorial very good quality and lot of time for that I guess, so respect, you are a good man helping people!!! btw I love ur laugh AHAH

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      You're welcome! And thanks 😂

  • @user-fq2yq4cy1b
    @user-fq2yq4cy1b 6 หลายเดือนก่อน

    I'm just starting this tutorial and it looks awesome, I'll drop a review when M done

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Enjoy 😊

  • @Rantsa_Jonathan
    @Rantsa_Jonathan 11 หลายเดือนก่อน

    thank u very much for this playlist of video this help me so much

    • @Spellthorn
      @Spellthorn  11 หลายเดือนก่อน

      I'm glad, you're enjoying it. This is only the beginning, enjoy

  • @nandaletro
    @nandaletro 4 หลายเดือนก่อน

    amazing tutorial!

    • @Spellthorn
      @Spellthorn  4 หลายเดือนก่อน

      Thank you!

  • @AnimeEmpowermentHubster
    @AnimeEmpowermentHubster 11 หลายเดือนก่อน

    ✅Awesome video, simple and easy to understand.✅

    • @Spellthorn
      @Spellthorn  11 หลายเดือนก่อน +1

      Glad you liked it

  • @user-zg9px9bo6y
    @user-zg9px9bo6y 11 หลายเดือนก่อน

    Omg thanks for this! I ❤ u

    • @Spellthorn
      @Spellthorn  11 หลายเดือนก่อน +1

      You're welcome! Glad you're enjoying it, there's a lot of videos available for you to watch 😁

  • @muhammadissasabbagh1540
    @muhammadissasabbagh1540 ปีที่แล้ว

    That's really cool tutorial , thank you very much

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว

      You're welcome, episode 2 is already up if you want to check that out too 😁

    • @muhammadissasabbagh1540
      @muhammadissasabbagh1540 ปีที่แล้ว

      @@Spellthorn I will 😀

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว

      I appreciate it. I hope you like it 😁

  • @sb-dor
    @sb-dor 10 หลายเดือนก่อน

    Hi there! Awesome video, greate job! Could you plz tell me what theme are you using for your vs code?

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      Umm, I think I'm just using material theme

  • @TYNEPUNK
    @TYNEPUNK 5 หลายเดือนก่อน

    amazing! thanks so much

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Glad you like it!

  • @icecream-wzsz
    @icecream-wzsz 6 หลายเดือนก่อน

    SO AMAZING

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Thanks 😊

  • @darielavila5183
    @darielavila5183 ปีที่แล้ว

    i always like your videos🖤

    • @Spellthorn
      @Spellthorn  ปีที่แล้ว +1

      I appreciate that 😁

  • @legitjimmyjaylight8409
    @legitjimmyjaylight8409 หลายเดือนก่อน

    This could be good because I have worked on adding ui to java libgdx game before and it is so much work to do it well.

  • @cuzunali
    @cuzunali 6 หลายเดือนก่อน

    amazing 👍👏👏👏

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Thanks a lot 😊

  • @user-oe9bh7fz3e
    @user-oe9bh7fz3e 4 หลายเดือนก่อน

    Bro i am not able to able to get the game layout on my phone can you help?

  • @aiman592
    @aiman592 3 หลายเดือนก่อน

    Hai great tutorial, but got stuck at the "LateError: Field 'cam' has not initialized". anyone face this error before

  • @AnimeFan-lx3gj
    @AnimeFan-lx3gj 6 หลายเดือนก่อน

    Thank you

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      You're welcome

  • @NaughtFound
    @NaughtFound 5 หลายเดือนก่อน

    Thank you for your engaging tutorial. For handling physics and collisions, I utilized Flame's built-in collision system. But, I cannot put the link to the project here!

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Did you use a circle hit box or a rectangle hit box? I was able to use the collision detection with a circle hit box but when it came to a square hit box I could never figure it out so went the different approach

    • @NaughtFound
      @NaughtFound 5 หลายเดือนก่อน

      @Spellthorn no it is rectangle hit box

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Oh that's awesome

  • @irhasm.a.4932
    @irhasm.a.4932 10 หลายเดือนก่อน

    what tools to have keyboard typing capture like that?

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน +1

      the tool is called KeyViz

  • @apeiron-soul
    @apeiron-soul 3 หลายเดือนก่อน

    I have a quick question. As someone with no prior experience in game dev and some experience in flutter, I'm eager to create my own
    game, but I'm unsure about the best approach. Should I follow your tutorials and recreate the game as you've demonstrated, or would it be better to use different assets and create my own game while following the general principles you've covered?

    • @Spellthorn
      @Spellthorn  3 หลายเดือนก่อน +1

      That's a great question. I feel a lot of people learn differently, I think following along with this tutorial and accomplishing what I make in the video would be very helpful to learn the basics etc and can start branching off where you feel is fit for your idea and vision. You could also just use this as a guide for different sections that you may be coming across, like my episode where I do sound, or my favorite one, where I make the enemy chicken.
      There's no wrong way to get started, also I would ask what your goal with having a game made with flame is, as if your goal is just making a video game I would say godot may be a better fit for that. For me flame was interesting cause I love flutter, but in terms of actually making a good game I feel like Flame may have been much harder way to accomplish the same thing in say Godot.
      Hope this helps, and good luck on your journey 😊

    • @apeiron-soul
      @apeiron-soul 3 หลายเดือนก่อน

      @@Spellthorn Thanks a lot!

  • @themediocre_coder
    @themediocre_coder 5 หลายเดือนก่อน

    How can I make the camera have a viewport that is a fixed aspect ratio and still have the camera follow the player. Im trying to make my game responsive but Im having trouble with this :(

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      This shouldn't be too difficult, you would pass in the players location to the camera

  • @sujalmistry7677
    @sujalmistry7677 4 หลายเดือนก่อน

    I want your help to load large map in flutter flame can you help me

  • @jimcoles5697
    @jimcoles5697 3 หลายเดือนก่อน

    Cannot get mine to work. I think it has to do with the Camera. Can someone please show the updated code from 26:35. Thanks.

    • @Spellthorn
      @Spellthorn  3 หลายเดือนก่อน

      Sorry to hear about that. I believe a lot of people are running into some issues due to a future update or something. I think someone in the comments may have a solution

  • @smurfolissicus
    @smurfolissicus 9 หลายเดือนก่อน

    nice video

    • @Spellthorn
      @Spellthorn  2 หลายเดือนก่อน

      Thanks 😊

  • @theman3282
    @theman3282 10 หลายเดือนก่อน

    i was wondering why flame not expanding to 3D as well...this libs is nice and easy to use (at least for me).

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      Well this would be a 2d engine, you can fake 3d like they did back in the day, but just a 2d engine for now

  • @ABDTalk1
    @ABDTalk1 5 หลายเดือนก่อน

    Can we make the game for desktop with this?

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Yea, Flutter makes cross platform easy.

  • @rajehgharbi6264
    @rajehgharbi6264 10 หลายเดือนก่อน

    i have a question how to add levels ?

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      We add more levels in episode 7

  • @WeI1994
    @WeI1994 10 หลายเดือนก่อน

    I tried to follow the turtorial, but I just cannot get the CameraComponent.. seems like they have changed the Api to Camera and Viewport.. can you please update on how to solve it?

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      Can you show me what you have? This tutorial still works perfect in new update of flame

    • @WeI1994
      @WeI1994 10 หลายเดือนก่อน

      @@Spellthorn I really just follow whats in shown.. but CameraComponent just won't work:/

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      Can you copy paste the code here ill see if anything wrong

    • @WeI1994
      @WeI1994 10 หลายเดือนก่อน

      @@Spellthorn
      import 'dart:async';
      import 'package:flame/components.dart';
      import 'package:flame/game.dart';
      import 'package:pixel_adventure/Levels/level.dart';
      class PixelAdventure extends FlameGame {
      late final CameraComponent cam;
      @override
      Future? onLoad() {
      return super.onLoad();
      }
      }
      Error>
      Undefined class 'CameraComponent'.

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      So late is expecting you to add the camera later like in the onload. Which I don't see you are doing

  • @zstrizzel
    @zstrizzel 9 หลายเดือนก่อน

    or-THAH-gah-nawl -- great video

    • @Spellthorn
      @Spellthorn  2 หลายเดือนก่อน

      Thanks 😊

  • @Nagimulia
    @Nagimulia 6 หลายเดือนก่อน

    more game tutorial!!!!

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน +1

      Have you watched the series?

    • @Nagimulia
      @Nagimulia 5 หลายเดือนก่อน

      yes, it is cool!@@Spellthorn

  • @johnwiese5927
    @johnwiese5927 4 หลายเดือนก่อน

    Wondering if anyone has figured out how to get the level to load, I am getting the same error that @spellthorn gets in the video at 23:41. The problem is changing the assets is not working like it did in the video so either something has changed in the code for TiledComponent or there is another change needed to make it work.
    class PixelAdventure extends FlameGame {
    @override
    FutureOr onLoad() {
    world = Level();
    camera = CameraComponent.withFixedResolution(world: world, width: 640, height: 360);
    camera.viewfinder.anchor = Anchor.topLeft;
    addAll([camera, world]);
    return super.onLoad();
    }
    }
    class Level extends World {
    late TiledComponent level;
    @override
    Future onLoad() async {
    level = await TiledComponent.load('Level-01.tmx', Vector2.all(16));
    add(level);
    return super.onLoad();
    }
    }
    flutter:
    uses-material-design: true
    assets:
    - assets/tiles/
    - assets/images/Terrain/

    • @johnwiese5927
      @johnwiese5927 4 หลายเดือนก่อน

      So, funny story, I just switched to run on Windows and it works. Won't work on Android, even after uninstalling the app and deploying again????

    • @Spellthorn
      @Spellthorn  3 หลายเดือนก่อน

      glad you got it sorted out

    • @Spellthorn
      @Spellthorn  3 หลายเดือนก่อน

      very weird not working on android, hmm

  • @ShakeelTariq
    @ShakeelTariq 10 หลายเดือนก่อน

    Bob Ross moment @15:28

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน +1

      🤣

  • @user-el5pz9wx2b
    @user-el5pz9wx2b 10 หลายเดือนก่อน +1

    hey im not gettin any image on the screen dont know what am i doing wrong and im not getting any error this is my code
    class PixelAdventure extends FlameGame{
    @override
    Color background() => const Color(0xFF211F30);
    late final CameraComponent cam;
    final world =Level();
    @override
    FutureOr onLoad() {
    cam = CameraComponent.withFixedResolution(world: world, width: 640, height: 360);
    cam.viewfinder.anchor= Anchor.topLeft;
    addAll([cam,world]);
    return super.onLoad();
    }
    }

    • @Spellthorn
      @Spellthorn  10 หลายเดือนก่อน

      This section doesn't necessarily look wrong. Is the background color working if you change colors? What does your level file look like?

    • @jhonatanamortegui5852
      @jhonatanamortegui5852 5 หลายเดือนก่อน

      I had the same problem. My mistake was that y didn't add the TiledComponent in the method onLoad() inside the Level class.

    • @prathibhasathyanjalee5163
      @prathibhasathyanjalee5163 5 หลายเดือนก่อน

      @@Spellthorn I am facing the same issue. The background color is working if it changed but the image is not loading. Can see an exeption like 'E/flutter (15912): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unable to load asset: "assets/images/../images/Terrain/Terrain (16x16).png".
      E/flutter (15912): The asset does not exist or has empty data.'

  • @ig_strawhats_
    @ig_strawhats_ 7 หลายเดือนก่อน

    i am so excited to learn this project

    • @Spellthorn
      @Spellthorn  5 หลายเดือนก่อน

      Hope you enjoyed it 😊