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/ - Навчання та стиль
I hope the Flutter team recognizes how great your tutorials are, and promotes them!
Thanks 😊
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!
I'm glad its helping you learn 😁
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.
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.
Thoroughly understand the working of "Adding player".
Amazing Tutor.
Thank you 😊
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!
best flame tutorial series great work keep it up
Glad you think so! Making some good progress so far, enjoy 😁
Excellent Tutorial! I am really enjoying it!
I died with the mistaken idle animation 🤣 LOL
Haha woops 😂
Awesome Flutter flame tutorial 👍👍👍
Thank you, glad you're enjoying it
Awesome sir, Thank you so much for this well explained tutorial.
Glad you found it useful ☺️
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.
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
Very nice explanation thank you so much sir 🙏🏼🙏🏼🙏🏼
Thanks I'm glad it was helpful
Your accent is awesome, btw i'm loving this series keep going ... ❤
Thanks 😁 I'm having a lot of fun. Learning a lot too
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;"
Glad you enjoyed it 😁 I never know when I should use static consts. Still getting the hang of using them thanks for the advice
Awsome 😀
Thanks 😊 making big progress 😁
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 :)
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
Greate lesson
Thank you, glad you enjoyed it
amazing coding style!!!!
Thanks 😊
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.
Thanks for that I think I discovered that later and was like oh duh that makes sense
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...?
I just loved the way you explained things but can you tell me how or where did you create those characters.
They are from an asset pack. Link is in description for them
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 :(
your voice is lovable
😂 thanks
17:45 the player in whaat ?? 🤣🤣
Anyway, i love your video.
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
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 :)
You can always click the tip button 😂 I'm glad you enjoyed them though 😊
17:48 dude :P i knew it !
feel free to delete comment when you see it :P
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
On your level file, if the spawnPointsLayer is null, then the code will crash on line 20. Other than that, it's amazing tutorial! ❤
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 😊
@@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!
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 😁
@@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 😍
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. 😁
❤️
17:47😂
sorry, are supposed to just skip @17:48 pretending it didn't happen?? oh man 😅😃
Haha woops 😂