+Atarius Maximus Posted August 14 Share Posted August 14 I've got a question for @Random Terrain or anyone else who has played around with the Collision Prevention sample code. I'm having a hard time wrapping my head around the logic behind it. It works great with an 8x8 sprite, but I was attempting to make it work with a much smaller sprite (a 2x3 block) and I can't seem to figure out how to update the math in the sample program to accommodate the smaller sprite. I was looking for 2x3 specifically as I'm working on a project that uses a ball sprite of that size, and what I really want is the "sticky wall" prevention. Any help with figuring this out would be much appreciated. I'm attaching the sample code that I've been using to test. sample.bas sample.bas.bin 2 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 14 Share Posted August 14 I just play around with it until it works since I'm bad at math. I'll look at it later today after the dryer fix-it-guy comes. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 15 Share Posted August 15 The dryer guy looked at the dryer and came back less than an hour later with the part and fixed it. I thought I'd have to wait many days. Anyway, my brain seems to be working good enough to look at the program. I'll compare it to a program I've been working on and see if I've made any improvements to the collision code. Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted August 15 Author Share Posted August 15 Glad to hear your dryer was fixed quickly! I spent an hour or so making mostly random guesses on modifications to make the smaller sprite work correctly with the sliding around walls effect, and nothing seemed to work as I expected. I was hoping you or someone could clarify a bit on what each of those lines of code is really doing, I wasn't able to follow it very well. It would be great if you could figure out how to make it work with a smaller sprite, but don't spend forever on it on my account. 1 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 15 Share Posted August 15 I used pfpixel and hours of playing with the numbers and it finally seems to be working correctly: Here's the .bas file code: c_test_2024y_08m_15d_1623t.bas Here's the .bin file to use with your favorite emulator: c_test_2024y_08m_15d_1623t.bin Rub the sprite along the walls as roughly as you can to see if I messed anything up. I removed a bit of code from the up and down sections since the sprite is so small and didn't seem to be necessary, but that could have introduced more problems. We won't know until you get wild with the wall rubbing to see if there is a problem. 2 1 Quote Link to comment Share on other sites More sharing options...
+Atarius Maximus Posted August 15 Author Share Posted August 15 Thank you so much RT! I really appreciate the time and effort you put into this. Time for some furious wall rubbing! 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.