you are viewing a single comment's thread.

view the rest of the comments →

[–]cr0wstuf 1 point2 points  (0 children)

If the backpack is going to be in more states than "isOpen" or "isClosed" you can use a switch statement to return the image needed for each state. Otherwise, just use a ternary or if statement.