Need to put a limit on a loop
Mostrar comentarios más antiguos
I have an elseif statement that detects when a ball enters into a circle. The problem is that once the ball enters the circle it does not leave fast enough sometimes and keeps running the else if statement. I need the loop to only execute once and then wait a certain amount of time before it can be used again.
elseif distsq1 <= Circle1Radius.^2
plot(circleXs,circleYs,'b');
bounce([(ballVector(1)), (Y_FACTOR + -1*(ballVector(2)))]);
Thoughts?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Animation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!