Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+2 votes

As the envelopes will move randomly all over the place, I'm now stuck on how to prevent them from moving outside of the screen. Do you guys have any idea or approach to solve that problem?

asked in CSC201 Spring 2021 by (1 point)

2 Answers

+1 vote
 
Best answer

Set up a series of if statements for each "wall" and if the envelope hits that wall, change the direction it is moving

answered by (1 point)
selected by
0 votes

I think we might use the same code like in the donut shop, where the sprinkles can only be inside the donut, then this time the envelope can only inside the screen

Thats what I think right now

answered by (1 point)
...