# Interactive Animations and Games 18.1

**URL:** <https://forum.code.org/t/interactive-animations-and-games-18-1/41548>\
**Category:** Uncategorized\
**Created:** [November 12, 2025, 3:51pm UTC](https://forum.code.org/t/interactive-animations-and-games-18-1/41548 "2025-11-12T15:51:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwalsh1](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@jwalsh1](https://forum.code.org/u/jwalsh1)\
**Post date:** [November 12, 2025, 3:51pm UTC](https://forum.code.org/t/interactive-animations-and-games-18-1/41548/1 "2025-11-12T15:51:41Z")

</div>

Can anyone tell me the code that made this sample interactive card?

Interactive games and animation lesson 18 level 1

> **[Code.org](https://studio.code.org/users/sign_in)**
>
> Anyone can learn computer science. Make games, apps and art with code.

---

<div class="post-metadata">

**Author:** ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)\
**Post date:** [November 17, 2025, 9:10pm UTC](https://forum.code.org/t/interactive-animations-and-games-18-1/41548/2 "2025-11-17T21:10:32Z")

</div>

Hi @jwalsh1 ,

That is a fun card. There are a few things going to but I think if you break it down it involves:

- a user action (like mouseIsOver)
- a sprite property reaction using a random number
- all of this in the draw loop so the event is always being checked to see if it is happening.

[Here is a sample project](https://studio.code.org/projects/gamelab/PYO2WsRG32UUuy6qnstKaR6FzbqZRNJNDA5uJJvZliY) to show the basics. I hope it helps:)

~Michelle
