Codex collision detection?

Hi! I’m trying to make a few tiny games and I keep running into the same problem. I can’t figure out which sentence that allows collision detection. These are an example of instructions I’ve given to Codex:

spawn a square, 100 px wide and high. Spawn it in the center of the page.
control the square with W A S D
Spawn a tiny black square somewhere on the page, not on top of the red square.
If the red square touches the tiny square, move the tiny square to a new position.

Last instruction doesn’t seem to be precise enough and I can’t figure out how to fix it. Can someone possibly help me out? Thanks in advance!

1 Like

Have you tried asking for ‘collision detection’ directly?

if collision detected between red square and black square, move the black square to a new position.

Didn’t work :confused:

Actually after repeating the request a few time, asking for collision detection worked. Thanks!

No problem. Hope you get your program finished :slight_smile: