Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collision Detection
#11
Thanks, bplus, I hadn't thought to ask an AI. 

From the "Overview:"
"Yes, it is highly likely to be a compatibility issue, specifically with Apple Silicon (ARM-64) or the macOS version (15.6.1/Sequoia)."
Guess what version of MacOS I'm running?!  

And this:
"Disclaimer: This error indicates a bug in the software itself (SideGunnerX) that needs to be resolved by the developer, rather than a failing Mac component."
Jeez, no need to get personal... This "developer" is doing nothing radical with his BASIC code, lol.  Confused  Well, at least it runs fine without optimization. Maybe I'll update to the latest MacOS Tahoe 26.3 and hope that doesn't break something else.
Reply
#12
If your doing some form of collision then I can think of couple of ways to do it that is easy on old computers.

1. Axis Aligned Bounding Box 
 
Code: (Select All)
Overlap = Ax < Bx + Bwidth AND Ax + Awidth > Bx AND Ay < By + Bheight AND Ay + Aheight > By
- One of the quickest
- Use it cull out objects that are not even close, for slower checking.

2. Overlapping Circles
Code: (Select All)
SCREEN 12
aRad = 20
bRad = 30
bx = 200: by = 200
DO
  DO WHILE _MOUSEINPUT
    CLS
    ax = _MOUSEX: ay = _MOUSEY
    CIRCLE (ax, ay), aRad!
    CIRCLE (bx, by), bRad!
    LOCATE 1
    PRINT "Collision:"; sqCollision(ax, ay, bx, by, aRad, bRad)
    _DISPLAY
  LOOP
LOOP UNTIL INKEY$ <> ""

FUNCTION sqCollision (ax, ay, bx, by, aRad, bRad)
  x = ax - bx
  y = ay - by
  sq = x * x + y * y
  radius = aRad + bRad
  sqCollision = (sq < radius * radius)
END FUNCTION

-Doesn't use a slow square root.

Hope this helps!
Reply
#13
Thanks, @justsomeguy! +1  I'm pretty familiar with those routines from Terry Ritchie's Tutorial, which I referred to a lot a couple years ago. 

Collision Detection, Chapter 15

My checks for collision only happen briefly when the mouse is clicked or some other event triggers it. I'm not checking throughout the program and speed hasn't been an issue. Still, I want the program lean and mean. I'll eventually test it on an older PC laptop I have around here... somewhere.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error doing image collision detection with _MemGet madscijr 55 4,645 10-01-2025, 03:25 PM
Last Post: bplus
  LAN detection problem eoredson 0 339 05-20-2025, 04:48 AM
Last Post: eoredson

Forum Jump:


Users browsing this thread: 1 Guest(s)