Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+1 vote

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 (8 points)

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 (8 points)
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 (8 points)
...