06:09 Quick tip: there's a shorter sintax for super parameters: class Enemy extends SpriteAnimationGroupComponent { Enemy({ super.position, super.size, }); } This also provides the Enemy class with type annotation when using it, they inherit the super's types, otherwise these two parameters are treated as "dynamic".
Instead of magic delays we can observe when animation has ended ``` void _respawn() { gotHit = true; current = PlayerState.hit; final hitAnimation = animationTickers![PlayerState.hit]!; hitAnimation.completed.whenComplete(() { current = PlayerState.appearing; scale.x = 1; position = startingPosition - Vector2.all(32); hitAnimation.reset(); final appearingAnimation = animationTickers![PlayerState.appearing]!; appearingAnimation.completed.whenComplete(() { position = startingPosition; current = PlayerState.idle; gotHit = false; appearingAnimation.reset(); }); }); } ```
in 34:06 you can use ..loop=false in declaring hit animation to disable loopping . hitAnimation = _getSpriteAnimationForEachBehaviour( amount: 7, state: 'Hit', characterType: characterType, )..loop = false;
Good stuff, I'm following along. One thing I did change was the rotation direction of the saws. I think they look better reversed - animation = animation!.reversed();
Just awesome. Love seeing how someone can write code in such a nicely organized and thoughtful way. If it were me, I'd use async/await with the Future.await so that it doesn't get nested, but this is perfect already.
47:30 in the update method, the gotHit check is preventing gravity from being applied to the player. Perhaps you should apply gravity to the player regardless its state?
I didn't want my player gravity to continue if player was hit i want him "frozen" in place, which is why I went with this approach, but yes that approach could work as well since it happens so quick
What about joystick , i mean you haven't done the jump thing there , please tell me how to do it ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
06:09 Quick tip: there's a shorter sintax for super parameters:
class Enemy extends SpriteAnimationGroupComponent {
Enemy({
super.position,
super.size,
});
}
This also provides the Enemy class with type annotation when using it, they inherit the super's types, otherwise these two parameters are treated as "dynamic".
Thank you for that advice. Someone else also mentioned that as well, just haven't switched to that yet 😁
Instead of magic delays we can observe when animation has ended
```
void _respawn() {
gotHit = true;
current = PlayerState.hit;
final hitAnimation = animationTickers![PlayerState.hit]!;
hitAnimation.completed.whenComplete(() {
current = PlayerState.appearing;
scale.x = 1;
position = startingPosition - Vector2.all(32);
hitAnimation.reset();
final appearingAnimation = animationTickers![PlayerState.appearing]!;
appearingAnimation.completed.whenComplete(() {
position = startingPosition;
current = PlayerState.idle;
gotHit = false;
appearingAnimation.reset();
});
});
}
```
Yea animationticker are definitely the best way to go. Thanks 😊
Awesome!! works very well!
in 34:06 you can use ..loop=false in declaring hit animation to disable loopping .
hitAnimation = _getSpriteAnimationForEachBehaviour(
amount: 7,
state: 'Hit',
characterType: characterType,
)..loop = false;
Thanks for the advice 😁
I did this ant it worked😃😃
DUDE , This is AMAZING . Been waiting for a SOLID Flame tutorial . THANKS SO MUCH
You're welcome, thanks for watching
the best tutorial and you are the best teacher. thank you🙂
You can use oncollisionend property instead of delay which may work perfect
And thanx for sharing this quality content
Good stuff, I'm following along. One thing I did change was the rotation direction of the saws. I think they look better reversed - animation = animation!.reversed();
I'll have to see how reversed looks 😁
It's an honour to be the first to comment on this historical video. Thanks brother you are awesome.
😄 thank you glad you're enjoying them 😊
@@Spellthorn 6 minutes into it please don't interrupt. And your voice is what I was surfing for on this Internet thing.
🤣 sorry ill be quiet 🤫
Just awesome. Love seeing how someone can write code in such a nicely organized and thoughtful way.
If it were me, I'd use async/await with the Future.await so that it doesn't get nested, but this is perfect already.
Thanks for the advice 😊
Bravo 👏🏻! That’s Incredibly Awesome! Cheers!🥂❤️✨
Thank you, glad you enjoyed it 😁
47:30 in the update method, the gotHit check is preventing gravity from being applied to the player. Perhaps you should apply gravity to the player regardless its state?
I didn't want my player gravity to continue if player was hit i want him "frozen" in place, which is why I went with this approach, but yes that approach could work as well since it happens so quick
Amazing one one again.
Glad you think so!
These are amazing! 🙏
Glad you think so! 😁
Outstanding content !!
Glad you enjoyed it 😁
You are awesome
Thanks 😊
Awsome 😍😍
Glad you like it 😁
What about joystick , i mean you haven't done the jump thing there , please tell me how to do it ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
😍😻❤
Glad you enjoyed it 😁
bro how can i contact you i have an error in my code
Sorry I've been away, I hope you figured it out