Jump to content

Collision detection fun.

Posted by atari2600land, in Commodore 64 12 December 2018 · 60 views

It's one of those cases where the game looks exactly the same but the code is different. In this case a lot different. I noticed some stuff. Like how sometimes if the burger is touching the cloud and the fry hits the broccoli the broccoli doesn't disappear. So I slowed the game down a little. Didn't help. I saw something though. I wondered if I could determine the sprite collisions of more than two sprites if I used $D019. A few false starts later I got it working.
Sprite 0 is the burger, sprite 1 is the cloud, sprite 2 is the fry and sprite 3 is the broccoli. I put this in:

          LDY $D01E ;Read hardware sprite/sprite collision          
          CPY #$0C
Meaning that if the sprite collision register always had sprite 2 and 3 touching no matter what other sprites were touching them, it would go off. Because %1100 is $C and anything above it would mean that the cloud and/or the burger were touching when the collision was happening as well.
Now my brain is completely fried. I unplugged the Commodore 64 because I was done with it for now. I plugged in and played my X-Box for a little bit. I will plug the Commodore 64 back in because I bought a game on ePay: Congo Bongo.
I went to sleep at 10:30 last night and I got up at 10:30am and said "I don't want to get up even though I really should," but I didn't get up and slept more until about 1pm. I wish I wasn't so sleepy all the time.

January 2019

2021 22 23242526

Recent Entries

Recent Comments

Search My Blog

Search My Blog