4 comments

  • Luc5 minutes ago
    This seemed promising at the beginning, but do yourself a favor and skip to the end to see the hilariously slow end result.
  • kleiba236 minutes ago
    Fun fact: a bouncing ball was one of the first programs that the C64 User Guide taught you: <a href="https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;commodore-64-user-guide&#x2F;page&#x2F;n57&#x2F;mode&#x2F;2up" rel="nofollow">https:&#x2F;&#x2F;archive.org&#x2F;details&#x2F;commodore-64-user-guide&#x2F;page&#x2F;n57...</a><p>Yes, that&#x27;s right kids: the C64 came with a manual that didn&#x27;t just teach you where to flip the power switch of your computer but actually how to program it!
  • juancn34 minutes ago
    Nice!<p>Why not just go full character mode?<p>The smooth motion is nice, but a bit of overkill, also it adds complexity to the collision code.<p>I suspect this can be done using a variation of Bresenham&#x27;s line algorithm for the trajectories (keeping delta X and delta Y for each ball) and avoid most&#x2F;all of the complex trig and math. Just addition and subtraction and a few sign changes.<p>The delta can be kept at a higher resolution than the grid (i.e. 16x so a mask can be used instead of division), so you can fudge the collision with small delta changes on impact using the SID as a RNG.
    • Two9A14 minutes ago
      Hey, thanks for checking this out. I wanted smooth motion to keep close to the JS piece that inspired this; it seemed like it should be eminently possible to get smooth motion, after all.<p>And yeah, I was reminded of Bresenham&#x27;s algorithm a few days back, and had a suspicion that I&#x27;ve basically redone it independently (and inefficiently) by doing the trig. As mentioned at the end there, the math isn&#x27;t where I&#x27;m losing most time in rendering though.<p>The Mastodon release post (cite 0) has comments talking about doing the score recalculation only at time of collision, but the worst thing I do is use a block of RAM for the playing field and another block of RAM for the _display_ of the playing field. Copying those blocks of 20 bytes, gosh it&#x27;s slow.
    • dosisking20 minutes ago
      I think it&#x27;s easier to implement with sprites, but the complex trig and math is unnecessary either way.
  • Two9A1 hour ago
    Over the years I&#x27;ve written a bunch of things in the orbit of retrocomputing, the largest of which was an incremental game based on a C64 emulator. Somehow I&#x27;ve never written anything substantial for the C64 itself; this post documents my learning while implementing a graphical effect in assembly language, over the course of twelve thousand words and three digressions into side quests.<p>Let me know if this was entertaining, useful or even both.