English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 02 October 2017, 20:52   #1
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Fast(est) method for bounding box collisions?

Hi! What's the fastest way of testing bounding box collisions in BB2? Is there any built in functions for that or do I need to make my own system? I guess there is no short-circuit evaluation going on in BB2 so it might be faster to check for bounding box collisions in multiple if clauses instead of combining them. Grateful for any insight!
MickGyver is offline  
Old 02 October 2017, 21:09   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
I can't comment on the speed, but the RectsHit command might be what you're looking for:

RectsHit (X1,Y1,Width1,Height1,X2,Y2,Width2,Height2)

Returns true if they overlap.

I love that, in the manual, they actually say "Care should be taken with the pronunciation of this command."
Daedalus is offline  
Old 02 October 2017, 21:17   #3
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Thanks! I will try the RecShit command!
MickGyver is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
SetCol/DoColl-How to test collisions with different sprites against different colors? Shatterhand Coders. Blitz Basic 1 12 January 2017 18:51
[REQ:ASM] Sprite collisions basics jman Coders. Tutorials 5 03 September 2011 00:07
Disable Sprite Collisions DeAdLy_cOoKiE Retrogaming General Discussion 4 24 March 2006 17:56
WANTED: A600 wild weird wicked box - just the box :P Smiley MarketPlace 0 23 May 2005 17:51
Mon nom est Pond, James Pond ! RCK Retrogaming General Discussion 9 12 December 2001 15:20

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:51.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06708 seconds with 15 queries