so i was working on problem set 0, I have made a project where when a user points the mouse over an animal it plays it's sound, so far i have been able to use if-else conditions and loops, but it requires me to use a variable for project too, so can anyone help me by giving ideas how i can implement it? i hope that it's fine to ask question like this.


1 Answer 1


Hi @user1406 and welcome to the CS50 community. Here you go,

In order to declare a new variable, in the variables palette, click "Make a Variable". A box will appear. Type the name of the variable you want to create, and select weather it should be "for all sprites" (global) or "for this sprite only" (private). Press OK. The image of the button looks like: Variable Making

You can do a lot of things with variables, they can range from Displaying score to even adjusting them in order to make interactive games!

Happy Coding!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .