Adding Player | Create an Amazing Game with Flutter & Flame

Поділитися
Вставка
  • Опубліковано 18 чер 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 back to our game development tutorial series on building a game using Flutter and Flame! In this second video, we'll continue our journey by focusing on creating the player character and implementing animations for them in our game.
    We'll start by designing the player's appearance and creating the necessary assets, such as sprites or vector graphics, to represent them in the game world. You'll learn how to import these assets into your Flutter project and utilize them within the Flame game engine.
    Next, we'll delve into the exciting world of animations. We'll guide you through the process of setting up animation controllers and defining animation sequences for your player character. You'll discover how to create smooth transitions between different states, such as walking, jumping, and attacking, giving your game a lifelike and dynamic feel.
    As we progress, we'll demonstrate how to integrate user input with the player's movements and animations. You'll learn how to respond to touch gestures or keyboard events and update the player's position and animation accordingly. We'll explore techniques for creating responsive and intuitive controls, ensuring an immersive gaming experience.
    Throughout the video, we'll provide detailed explanations and practical examples, allowing you to grasp the concepts easily. You'll gain insights into best practices for organizing your code, structuring your animations, and optimizing performance.
    By the end of this tutorial, you'll have a fully animated player character that can navigate the game world with fluid movements. You'll understand the fundamentals of animation in Flutter and Flame, and how to apply them to bring your game to life.
    Remember to like this video and subscribe to our channel for more exciting tutorials on game development with Flutter and Flame. If you have any questions or suggestions, feel free to share them in the comments below. Let's continue our game development journey together and create amazing games!
    Stay tuned for the next video, where we'll explore collision detection and start building the game environment. Happy coding!
    🛡️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 UA-cam channel, they create informative and engaging videos that cover a wide range of programming topics. - spellthorn.com/
  • Навчання та стиль

КОМЕНТАРІ • 71

  • @dcdales
    @dcdales 5 місяців тому +8

    I hope the Flutter team recognizes how great your tutorials are, and promotes them!

  • @blakefarnsworth
    @blakefarnsworth Рік тому +12

    Really love how you explain things. You go at the perfect speed for me, and seeing you approach things in multiple ways to make the code more and more efficient is super helpful!

    • @Spellthorn
      @Spellthorn  Рік тому

      I'm glad its helping you learn 😁

  • @karansayata7447
    @karansayata7447 Рік тому +13

    I love how your voice sounds happy when you're teaching. Makes me excited to learn as well. P.S I also turned on notifications.

    • @Spellthorn
      @Spellthorn  Рік тому

      I love coding and it is something that should be fun. Especially if making a fun game 😁 I cant say it's always a easy go lucky time when I try to figure out this stuff to teach though. But hey, my pain is your gain haha.

  • @crazyvolt1660
    @crazyvolt1660 10 місяців тому

    Thoroughly understand the working of "Adding player".
    Amazing Tutor.

  • @callmebean4643
    @callmebean4643 Місяць тому

    I've been learning on a lot of Teaching Platform and I can tell that you're one of the best instructors 💪Keep up the good work!

  • @coderlyfe1023
    @coderlyfe1023 11 місяців тому +1

    best flame tutorial series great work keep it up

    • @Spellthorn
      @Spellthorn  11 місяців тому +1

      Glad you think so! Making some good progress so far, enjoy 😁

  • @MmUQue
    @MmUQue 9 місяців тому +1

    Excellent Tutorial! I am really enjoying it!
    I died with the mistaken idle animation 🤣 LOL

  • @anggapande8395
    @anggapande8395 11 місяців тому

    Awesome Flutter flame tutorial 👍👍👍

    • @Spellthorn
      @Spellthorn  11 місяців тому

      Thank you, glad you're enjoying it

  • @Sanatani-0811
    @Sanatani-0811 9 місяців тому

    Awesome sir, Thank you so much for this well explained tutorial.

    • @Spellthorn
      @Spellthorn  2 місяці тому

      Glad you found it useful ☺️

  • @wongvoonngee3307
    @wongvoonngee3307 10 місяців тому +1

    Great tutorial. For the Player class constructor, can write this way Player({super.position, required this.character}); so that the position param has type (Vector2) checked instead of dynamic type.

    • @Spellthorn
      @Spellthorn  10 місяців тому +1

      Thanks for the advice. Yea someone else stated I can use super. Rather than calling super after too. Just haven't updated to those yet

  • @someshsahu4638
    @someshsahu4638 10 місяців тому +1

    Very nice explanation thank you so much sir 🙏🏼🙏🏼🙏🏼

    • @Spellthorn
      @Spellthorn  9 місяців тому

      Thanks I'm glad it was helpful

  • @technicalguy.
    @technicalguy. Рік тому

    Your accent is awesome, btw i'm loving this series keep going ... ❤

    • @Spellthorn
      @Spellthorn  Рік тому

      Thanks 😁 I'm having a lot of fun. Learning a lot too

  • @DavidSerranoIO
    @DavidSerranoIO 10 місяців тому

    Great tutorial. The only thing I would change is to define the step time variable as static to take leverage of constant fields: "static const _stepTime = 0.05;"

    • @Spellthorn
      @Spellthorn  10 місяців тому +1

      Glad you enjoyed it 😁 I never know when I should use static consts. Still getting the hang of using them thanks for the advice

  • @muhammadissasabbagh1540
    @muhammadissasabbagh1540 Рік тому

    Awsome 😀

    • @Spellthorn
      @Spellthorn  Рік тому

      Thanks 😊 making big progress 😁

  • @arjenschuurman
    @arjenschuurman 10 місяців тому

    Great tutorial. Just a small remark: You can directly call super in the constructor, like: " Player({super.position}); " makes it a bit easier to read imho :)

    • @Spellthorn
      @Spellthorn  10 місяців тому

      Glad you enjoyed it, yea that was something I didn't know at the time but others have informed me also thanks for the tip

  • @boyuniversal8315
    @boyuniversal8315 11 місяців тому

    Greate lesson

    • @Spellthorn
      @Spellthorn  11 місяців тому

      Thank you, glad you enjoyed it

  • @fatihsonmez
    @fatihsonmez 9 місяців тому

    amazing coding style!!!!

  • @G11Marksman
    @G11Marksman 3 місяці тому

    33:21 the property is called 'class_' because 'class' is a reserved word in dart. You couldn't name a variable 'class' because that would look like the start of a class definition to the compiler.

    • @Spellthorn
      @Spellthorn  3 місяці тому

      Thanks for that I think I discovered that later and was like oh duh that makes sense

  • @jazzycoder
    @jazzycoder 7 місяців тому

    I have an exception whereby the android simulator version gets a Unable to load asset: "assets/tiles/level_01.tmx error. The strange thing is it works fine on macos desktop...?

  • @jhalakupadhyay9911
    @jhalakupadhyay9911 6 місяців тому

    I just loved the way you explained things but can you tell me how or where did you create those characters.

    • @Spellthorn
      @Spellthorn  6 місяців тому

      They are from an asset pack. Link is in description for them

  • @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 :(

  • @lutfiikbalmajid3128
    @lutfiikbalmajid3128 Місяць тому

    your voice is lovable

  • @DeoWibawa
    @DeoWibawa 7 місяців тому

    17:45 the player in whaat ?? 🤣🤣
    Anyway, i love your video.

    • @Spellthorn
      @Spellthorn  5 місяців тому

      Yea I couldn't find where I messed up to cut it out. But now figured I'd leave it in made a few people laugh

  • @danielelmuneco1994
    @danielelmuneco1994 2 місяці тому

    You really have wood for teaching. Glad you make them for free but you should know that I you were to have some paid courses, I would very likely paid for them hahaha.
    All I want to say is well done and thank you for sharing :)

    • @Spellthorn
      @Spellthorn  2 місяці тому +1

      You can always click the tip button 😂 I'm glad you enjoyed them though 😊

  • @dovas90
    @dovas90 10 місяців тому

    17:48 dude :P i knew it !

    • @dovas90
      @dovas90 10 місяців тому

      feel free to delete comment when you see it :P

    • @Spellthorn
      @Spellthorn  10 місяців тому

      Haha I was going to cut that out but then couldn't find it when editing, and not sure if i should remove it or not haha

  • @emadeddineibo1842
    @emadeddineibo1842 Рік тому +1

    On your level file, if the spawnPointsLayer is null, then the code will crash on line 20. Other than that, it's amazing tutorial! ❤

    • @Spellthorn
      @Spellthorn  Рік тому

      Thanks for the heads up. I deleted the spawn point for my player in tiled just now to test that but it doesn't crash the game no errors either. So should be good, glad you're enjoying it 😊

    • @emadeddineibo1842
      @emadeddineibo1842 Рік тому +1

      @@Spellthorn So if there's no group under the name , then it will return an empty array?
      Try to mistype the word 'Spawnpoints' to anything and check if it will crash or not, and thanks for keep working on it, I really enjoy every part of it!

    • @Spellthorn
      @Spellthorn  Рік тому +1

      I see what you are saying. You're correct, if there is no layer called Spawnpoints it will crash the app 🤣 but as long as layer called Spawnpoints it won't crash even if no spawnpoints added. I just figured out collisions today so excited to record episode 4 😁

    • @emadeddineibo1842
      @emadeddineibo1842 Рік тому +1

      @@Spellthorn That's great to know!
      I'm new to Flame & Games development in general, but I'm pretty good with Flutter so don't mind me, I'll be watching you 👀
      Really exited for the 4th part 😍

    • @Spellthorn
      @Spellthorn  Рік тому +2

      Yea Flame definitely is fun to work on. I feel the biggest struggle with Flame is learning what its capable of doing, where as if you made the engine yourself well you know every aspect of it as you had to code it 🤣 im glad to finally have my player able to jump around. 😁

  • @YaxineZone
    @YaxineZone 8 місяців тому

  • @QuickPodss
    @QuickPodss Місяць тому

    17:47😂

  • @dartneer
    @dartneer 9 місяців тому

    sorry, are supposed to just skip @17:48 pretending it didn't happen?? oh man 😅😃