Collision Detection in Scratch Using Pythagoras Theorem

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

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

  • @CoolScratcher
    @CoolScratcher 3 года назад +5

    Nice!!
    You have extremely high-quality vids

  • @PinStudiosOfficial
    @PinStudiosOfficial 11 месяцев назад

    That was really helpful, thank you so much! Could you perhaps do this, but with triangles?

  • @that_darkknight9066
    @that_darkknight9066 3 года назад +2

    Hi so, I can't tell if this is an issue with scratch or the way its coded, but whenever I walk over the enemy in my prototype it doesn't register that it happened. I was wondering if you could help me with this

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +1

      My guess is the code as it usually always is! I'll offer some debugging tips.
      1. Isolate the point where it was working and the point it was not working. Ask yourself what changed? What are you using?
      2. You mention you already have a prototype (awesome!). I always like to isolate something new or hard that I'm working on before inserting it into my larger project. This is like unit testing.
      3. Use say blocks to make it more visual. For instance, when you walk over the enemy, put a say block to say collision.
      4. Use the pen tool to draw the triangles and circles so that you can visually see what's going on.
      5. Work through this video step-by-step with the project source.
      6. Check your maths calculation for a bug.
      That's about all I have for you. Good luck!

  • @goldenfang6837
    @goldenfang6837 3 года назад +1

    what is the next tutorial?

  • @eightdigger354
    @eightdigger354 3 года назад

    Where do you get the distance x and y from

  • @nongstiker
    @nongstiker 3 года назад

    i need this project url

  • @jontoe.
    @jontoe. 2 года назад

    I just subbed :)

  • @goldenfang6837
    @goldenfang6837 3 года назад

    Is there a way to make the health go down without the complicated codes?

    • @SurfingScratcher
      @SurfingScratcher  3 года назад +1

      Hi golden fang, have you tried making this health bar in your own project? The health bar made in this video doesn't require the game. I just made the health bar for this particular game.
      If you haven't already, start a new project and follow along to make your own health bar.
      Also, if you want to simplify it even further, ditch the variable and just use the costume directly.

    • @goldenfang6837
      @goldenfang6837 3 года назад

      @@SurfingScratcher yes i have, i'm just trying to make damages to the health bar by running into other objects.

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      @@goldenfang6837 Just use the sensing block called 'touching'. If sprite touching other sprite then reduce health. You can simply put a wait block (say like 1 sec) to that you don't lose all your lives at once. That's about as simple as I can think of.

  • @nildaespinoza3442
    @nildaespinoza3442 3 года назад

    my brain cant process math

  • @nildaespinoza3442
    @nildaespinoza3442 3 года назад +1

    i dont have a clue wut ur talking about in ur trimonatry

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      Hi Nilda, visit some of the first videos in the series. That gives you an introduction to trigonometry in Scratch. With that said, if you don't already have a basic understanding of trig, these tutorials will be challenging. But it usually takes a few passes at the content for the lightbulb to turn on. Good luck!

    • @nildaespinoza3442
      @nildaespinoza3442 3 года назад

      @@SurfingScratcher im still grade 5

    • @SurfingScratcher
      @SurfingScratcher  3 года назад

      @@nildaespinoza3442 Then brush up on your understanding of percentages, fractions and ratios. That will give you a solid platform from which to understand trig. If you have the will, the way already exists. You can visit Khan Academy now to learn the concepts. But of course, you've actually got to want to do that in the first place ;) Good luck!