Coding Assistance

I’m a first year CS Discoveries teacher and am trying to code a sprite to travel back and forth (not randomly) across part of the screen (think fish in a fish bowl. Attached is the current version of the code.

Fish1 fish2 !

With this code the fish starts on the right of the bowl, gets to the left side and switches to the right facing fish and doesn’t move. I understand why…but I don’t know what to do instead.

Thank you in advance for whatever suggestions you can throw my way. I have also been playing with If/Else and If/Else if…not sucessfully.

1 Like

hi @karen_black,

Would you be able to share the link to your project? I’d like to try some things out

thanks!
Kevin

Thank you! I appreciate your time.

https://studio.code.org/s/csd3-2018/stage/14/puzzle/4?section_id=2147049

Hi @karen_black,
The link you shared doesn’t take me to the actual project. If you click on the ‘Share’ button on the top of your screen that’ll give you a link directly to your project. That way we can see the code and help you out better. Thanks!

Oh! Thank you. I didn’t realize…

https://studio.code.org/projects/gamelab/96YnakUQf8iD5Lf7OXcz0rpgqGxVUZRbWkaK66Y0iCI

Hi Karen,

Here is one way to cause this to happen. There are other ways also.

1 Like

Oh wow! That’s perfect! I haven’t used velocity before…I’ll play with it. I appreciate you taking the time to help me out. Thank you so much!

1 Like