Idk why but I get this error message: Expected an assignment or function call and instead saw an expression

if (timer = 98){
	xd1 == xd1 * -1;
	yd1 == yd1 * -1;
}

you mixed up == and =

This is better:


if (timer == 98) {
  xd1 = xd1 * -1;
  yd1 = yd1 * -1;
}
  • The == is for comparison
  • the = is for assigning a value
1 Like

Hey, and welcome to the forum, great to have you here!

:wink:

1 Like