+atari1byte Posted September 16, 2022 Share Posted September 16, 2022 Hello everyone! I am looking for documentation on sprites collisions with SecondBasic. Can you guys help me? Thank you all! Quote Link to comment Share on other sites More sharing options...
TheDevil'sCompass Posted September 17, 2022 Share Posted September 17, 2022 You have to write your own using hit boxes. With 2 sprites that are 8x8, a hitbox that surrounds the sprites would be Sprite1X, Sprite1Y to Sprite1X+7, Sprite1Y+7 and Sprite2X, Sprite2Y to Sprite2X+7, Sprite2Y+7. With those coordinates in mind, you'd write If-Then statements to see if any of those points intersect. Depending on what the sprites are you may be able to narrow your calculations. For instance, it may not be necessary to check the backend of a missile that always fires up at an alien ship. Check out the following attachment for lots of helpful examples. The projects for richardscape1.sbs and richardsescape 1.sbs have sprite collision routines that you can play around with and refine. https://forums.atariage.com/applications/core/interface/file/attachment.php?id=912957 2 Quote Link to comment Share on other sites More sharing options...
+atari1byte Posted September 17, 2022 Author Share Posted September 17, 2022 Thank you very much!!! Now I have more elements! 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.