Can you give an example of what kind of collisions you are struggling with making proportional?

Here is an example adapted from Thompson’s rect-rect demo: http://www.jeffreythompson.org/collision-detection/rect-rect.php

…but now with two rectangles defined using screen-relative properties.

```
/** Random screen size with scaled objects and collision detection
* 2019-06-05 Processing 3.4
* https://discourse.processing.org/t/i-need-help-with-scalibility-in-full-screen-sketches/11791/2
*/
float[] r1;
float[] r2;
void settings(){
// create a random screen size
int w = (int)random(100,1000);
int h = (int)random(100,1000);
size(w, h);
}
void setup() {
float mindim = min(width, height);
float maxdim = max(width, height);
// create a rect that is a 20th of the maximum screen dimension
r1=new float[]{0, 0, 0.05*maxdim, 0.05*maxdim};
// create a rect that is half the minimum screen dimension
r2=new float[]{0, 0, 0.5*mindim, 0.5*mindim};
// center the rect for the default rectMode -- although this is more elegant to express with rectMode(CENTER)
r2[0]=(width-r2[2])/2.0;
r2[1]=(height-r2[3])/2.0;
noStroke();
}
void draw() {
background(255);
r1[0] = mouseX;
r1[1] = mouseY;
boolean hit = rectRect(r1, r2);
if (hit) {
fill(255,150,0);
}
else {
fill(0,150,255);
}
rect(r2[0],r2[1],r2[2],r2[3]);
// draw the other square
fill(0, 150);
rect(r1[0],r1[1],r1[2],r1[3]);
}
boolean rectRect(float[] r1, float[] r2) {
if (r1[0] + r1[2] >= r2[0] && r1[0] <= r2[0] + r2[2] &&
r1[1] + r1[3] >= r2[1] && r1[1] <= r2[1] + r2[3]) {
return true;
}
return false;
}
```

This sketch is using vanilla rect/rect collision – the only proportional logic is at object creation, which in this case is in setup. Don’t change your collision logic at all – once your objects are generated with percentage-based coordinates, treat those coordinates like any other – they are just numbers.