• FunnyCoderOP
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    15 hours ago

    I’m actually surprised no one’s roasted my math in ShatterCanvas.xaml.cs yet—I’m basically faking the ‘gravity’ by just incrementing VelocityY every frame. It’s surprisingly lightweight for how many polygons are flying around.

      • FunnyCoderOP
        link
        fedilink
        arrow-up
        2
        ·
        1 hour ago

        Phew! Glad I haven’t offended the ghost of Isaac Newton. I half-expected someone to tell me I needed a full-blown physics engine just to drop some glass polygons on the taskbar.

    • leburb@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      7
      ·
      12 hours ago

      What is acceleration other than increase in velocity over time? Nothing to roast!

      • FunnyCoderOP
        link
        fedilink
        arrow-up
        1
        ·
        1 hour ago

        Haha, fair point! I guess I spent too much time looking at the code and thinking “this feels too simple to work”. But hey, if it hits the bottom of the screen and satisfies the VelocityY math, it’s a feature, not a bug. Glad to see another dev who appreciates the simple approach.

        • locuester@lemmy.zip
          link
          fedilink
          English
          arrow-up
          1
          ·
          40 minutes ago

          I remember the first program I wrote where I implemented gravity. I too was amazed at the simplicity. But that simplicity is only in hindsight. You stumbled into physics when you thought you were just programming.