Hi, I have a student who is trying to click on her sprite once (a graduatuion cap) and have it then move off screen. We cannot seem to figure out how to just click once instead of repeating clicks to get it off screen.
Without having the link to the project, it’s a little hard to tell the best way about it. If you’d like to give us a link to the student’s project using the Share button we could look at it more closely.
It does kind of depend exactly what you want it to look like, but one way to do it would be to use the blocks below …
As @edavis said, if your program needs to work a little differently, we could help if you send a link!
Thank you for the advice, here is the link to her project. My student wants the cap sprite to appear as if it is flying of the girl’s head on a diagonally with just one click.
Here is the link:
So, I created a variable (capFly) at the top of the program and set it to “false”. Then, inside the draw loop when the mouse is clicked, I set capFly to true. Then with another conditional block, I tell it if capFly is true, the x and y position of the cap need to change.
Here’s my remix of your student’s project.
Hope it makes sense.
Thank you!!! This worked great!