Pong Wars on the Commodore 64
imrannazar.com
Pong Wars on the Commodore 64
1–10 of 11 posts
Re: Pong Wars on the Commodore 64
#2Let me know if this was entertaining, useful or even both.
Re: Pong Wars on the Commodore 64
#3Yes, that's right kids: the C64 came with a manual that didn't just teach you where to flip the power switch of your computer but actually how to program it!
Re: Pong Wars on the Commodore 64
#4Why not just go full character mode?
The smooth motion is nice, but a bit of overkill, also it adds complexity to the collision code.
I suspect this can be done using a variation of Bresenham's line algorithm for the trajectories (keeping delta X and delta Y for each ball) and avoid most/all of the complex trig and math. Just addition and subtraction and a few sign changes.
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.
Re: Pong Wars on the Commodore 64
#5Nice! Why not just go full character mode? The smooth motion is nice, but a bit of overkill, also it adds complexity to the collision code. I suspect this can be done using a variation of Bresenham's line algorithm for the trajectories (keeping delta X and delta Y for each ball) and avoid most/all of the complex trig and math. Just addition and subtraction and a few sign changes. The delta can be kept at a higher res…
Re: Pong Wars on the Commodore 64
#6Nice! Why not just go full character mode? The smooth motion is nice, but a bit of overkill, also it adds complexity to the collision code. I suspect this can be done using a variation of Bresenham's line algorithm for the trajectories (keeping delta X and delta Y for each ball) and avoid most/all of the complex trig and math. Just addition and subtraction and a few sign changes. The delta can be kept at a higher res…
And yeah, I was reminded of Bresenham's algorithm a few days back, and had a suspicion that I've basically redone it independently (and inefficiently) by doing the trig. As mentioned at the end there, the math isn't where I'm losing most time in rendering though.
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's slow.
Re: Pong Wars on the Commodore 64
#7Re: Pong Wars on the Commodore 64
#8This seemed promising at the beginning, but do yourself a favor and skip to the end to see the hilariously slow end result.
Re: Pong Wars on the Commodore 64
#9Re: Pong Wars on the Commodore 64
#10Over the years I'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'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. Let me know if this was enterta…