Traps! | Create an Amazing Game with Flutter & Flame

Поделиться
HTML-код
  • Опубликовано: 29 ноя 2024

Комментарии • 44

  • @ricardomejias7957
    @ricardomejias7957 Год назад +7

    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".

    • @Spellthorn
      @Spellthorn  Год назад +1

      Thank you for that advice. Someone else also mentioned that as well, just haven't switched to that yet 😁

  • @Raix03
    @Raix03 Год назад +10

    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();
    });
    });
    }
    ```

    • @Spellthorn
      @Spellthorn  9 месяцев назад +1

      Yea animationticker are definitely the best way to go. Thanks 😊

    • @shivamamin1126
      @shivamamin1126 26 дней назад

      Awesome!! works very well!

  • @sudo8488
    @sudo8488 Год назад +3

    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;

  • @GarthFransman
    @GarthFransman Год назад +4

    DUDE , This is AMAZING . Been waiting for a SOLID Flame tutorial . THANKS SO MUCH

    • @Spellthorn
      @Spellthorn  Год назад

      You're welcome, thanks for watching

  • @azaderahmati8593
    @azaderahmati8593 4 месяца назад

    the best tutorial and you are the best teacher. thank you🙂

  • @Amankumar_Raone
    @Amankumar_Raone 2 месяца назад

    You can use oncollisionend property instead of delay which may work perfect
    And thanx for sharing this quality content

  • @bogbrushers
    @bogbrushers Год назад +4

    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();

    • @Spellthorn
      @Spellthorn  Год назад

      I'll have to see how reversed looks 😁

  • @tfozo
    @tfozo Год назад +2

    It's an honour to be the first to comment on this historical video. Thanks brother you are awesome.

    • @Spellthorn
      @Spellthorn  Год назад

      😄 thank you glad you're enjoying them 😊

    • @tfozo
      @tfozo Год назад

      ​@@Spellthorn 6 minutes into it please don't interrupt. And your voice is what I was surfing for on this Internet thing.

    • @Spellthorn
      @Spellthorn  Год назад +1

      🤣 sorry ill be quiet 🤫

  • @dcdales
    @dcdales 10 месяцев назад

    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.

    • @Spellthorn
      @Spellthorn  9 месяцев назад

      Thanks for the advice 😊

  • @JUANORQUIO
    @JUANORQUIO Год назад

    Bravo 👏🏻! That’s Incredibly Awesome! Cheers!🥂❤️✨

    • @Spellthorn
      @Spellthorn  Год назад +1

      Thank you, glad you enjoyed it 😁

  • @ricardomejias7957
    @ricardomejias7957 Год назад

    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?

    • @Spellthorn
      @Spellthorn  Год назад +1

      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

  • @crazyvolt1660
    @crazyvolt1660 Год назад

    Amazing one one again.

  • @tjghinder3979
    @tjghinder3979 Год назад

    These are amazing! 🙏

  • @DivyanshuSingh099
    @DivyanshuSingh099 Год назад

    Outstanding content !!

  • @denilsonwashuma1987
    @denilsonwashuma1987 Год назад

    You are awesome

  • @vlogbyatahan
    @vlogbyatahan Год назад

    Awsome 😍😍

  • @anandyerawar6473
    @anandyerawar6473 8 месяцев назад +2

    What about joystick , i mean you haven't done the jump thing there , please tell me how to do it ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

  • @gogu2120
    @gogu2120 Год назад

    😍😻❤

  • @Abhishek7Shah
    @Abhishek7Shah Год назад

    bro how can i contact you i have an error in my code

    • @Spellthorn
      @Spellthorn  9 месяцев назад

      Sorry I've been away, I hope you figured it out