Cross-Curricular Connections: Exploring the "Lucky Leprechaun" Unit

21st century skills algorithmic thinking block-based coding computer programming computer science content library jr coordinate plane critical thinking cross-curricular connections game game development geometry mathematics music programming project-based learning scratch software development technological literacy transferable skills Feb 27, 2024
Tiled shamrocks

This month’s unit feature focuses on our “Lucky Leprechaun” module in Content Library Junior. In this unit, students use Scratch to create a video game in which a leprechaun has to collect all of the coins in three different levels. Controlling a video game character, entering and exiting different levels, and music are just some of the many components of this game. While the game itself may seem basic, this is one of the more challenging projects you’ll find in Content Library Junior. Let’s take a look at the various cross-curricular skills learned and practiced in this activity!

The Scratch Editor

In the first portion of this activity, students learn to work with the Scratch editor to customize a premade backdrop. When hovering over the icon in the lower right hand corner of the Scratch workspace, you’ll see “Choose a Backdrop.” In the sample activity, the background chosen is already a part of the Scratch library. However, adding game instructions means the student needs to add elements to the backdrop.

If you’ve read through our other Cross-Curricular Connections sections or worked in a unit before, you’ll remember that many of the skills learned when using the editor apply to a variety of computer programs.

For example, a simple action like adding a text box is a skill that students can use across various computer programs. Many of our younger students do not yet have the typing skills or ability to easily navigate applications on a computer. Learning to add a text box, populate it with text, and then adjust the box to be placed in the exact location intended on the Scratch stage are all ways that a small action helps build technological literacy for our young learners.

Let’s return to the idea of populating the textbox. Students must be able to type the directions onto the backdrop for the opening screen. While children today are easily able to utilize technology through touch screens and apps, many do not have the basic typing skills needed both for school courses and for future careers. According to a recent study carried out by the National Skills Coalition, 92% of jobs require employees to have digital skills. At a very basic level, just being able to exchange emails with a teacher or boss remotely requires some typing ability.

So, even with the very first lesson and before any code is written, students are practicing valuable, transferable skills by working in the Scratch editor.

Moving the Leprechaun

Moving the leprechaun across the screen requires some math skills and knowledge of the XY coordinate plane. The leprechaun can be moved by using the arrow keys on the keyboard. In the Motion category in Scratch, the user has the option to move sprites - the programmable objects in Scratch - around the Scratch stage. The x-axis in Scratch ranges from -240 to 240, while the y-axis ranges from -180 to 180. Students should be able to visualize and understand what a coordinate plane looks like in order to comprehend what this means for their leprechaun game piece.

By using a combination of when [ ] key pressed from the Events category and change x/y by (10) instructions from the Motion category, students can choose which arrow key moves the leprechaun in which direction. For example, a combination of when [right arrow] key pressed and change x by (10) will move the leprechaun to the right when the right arrow key is pressed. The number 10 represents the number of steps the sprite will move. Because the x-axis ranges from -240 to 240, programming 10 steps will not make the leprechaun move too far and is a fitting number for creating a game piece that can move around.

This is an excellent opportunity to teach and/or reinforce understanding of positive and negative numbers. Positive values along the x-axis will move the leprechaun to the right whereas negative values along the x-axis will move the leprechaun to the left. Positive values along the y-axis will move the leprechaun up whereas negative values along the y-axis will move the leprechaun down. As students are focused on all of these concepts, they simultaneously need to have the typing skills to be able to add negative signs into the bubbles of the instructions in Scratch where necessary.

The Leprechaun's Position

The concept of the XY coordinate plane continues to be reinforced when discussing the leprechaun’s position on the screen. The backdrop differs for each level, so depending on what is on the backdrop or where the coins are located in each level, the programmer may want the leprechaun to start in a different position.

This is an opportunity for students to learn how to plot points on the coordinate plane. Once they understand that movement along the x-axis is horizontal and movement along the y-axis is vertical, students learn that (x,y) coordinates indicate an object’s (whether it be a sprite, a point, etc) exact location on the coordinate plane. A position of (-x, y) will place the object to the left and above the origin (the center point of the coordinate plane). A position of (-x, -y) will place the object to the left and below the origin. The coordinates (x, y) will place the object to the right and above, and so on.

So, while not the only mathematical skills at play, working with the coordinate plane is a significant cross-curricular skill that is employed in this program.

Interactive Introduction Screen

Another key feature of this unit is creating an interactive introduction screen, where clicking on a certain icon brings you to a different level of the game. This section of the program requires students to think of what the next step will be in order to be able to add the correct instructions.

For example, if clicking on the pot of gold brings you to a specific level, the programmer needs to have added that level/backdrop already in order to be able to select the correct instructions. Once the backdrop for the level exists, then the programmer can use a combination of when this sprite clicked instruction from the Events category and a switch backdrop to ( ) instruction from the Looks category. The drop down in the switch backdrop to ( ) instruction will only have backdrops that have already been added, therefore students are challenged to think of the program as a whole and which steps are necessary to take in order to make other steps possible.

In this game, there are three sprites - shamrock, rainbow, pot of gold - that bring you to different levels. To make this program resemble a true game, there needs to be an option to return to the main menu. This is where the Back Button sprite comes in. As with the icons on the main menu, the Back Button sprite needs to be programmed with a combination of when this sprite clicked and switch backdrop to ( ) instructions. Which backdrop do you think the button will switch to when clicked? We need to return to the main menu, so the backdrop selected will be whichever backdrop is the main menu. In this unit’s case, this is the Stripes backdrop from the Scratch library.


Additionally, the programmer does not want the main menu icons to appear in the various levels. Instead, they should only appear on the main screen. In contrast, the Back Button sprite should only appear in each level and not the main menu screen. This is the same with the “coins” in each level. This requires students to understand when to show and hide these sprites. Each sprite needs a when backdrop switches to [ ] instruction paired with either a show or hide instruction for all backdrops. Clicking the green flag every so often and testing each icon when clicked is a way for the user to check that the correct instructions have been chosen. As they are testing their program students can be thinking – “Is the program working as intended? If not, what needs to be changed?”

Changing the Score

To create a program with a score, students need to add a variable. A variable is a way of storing information that might change throughout a program. In the Variables category in Scratch, the user chooses “Make a Variable” and has the option to create a variable that applies either to a single sprite (known in programming as a local variable) or all sprites (known in programming as a global variable) in the program.

The programmer will also give the variable a name. For the Lucky Leprechaun Game, the variable is the score. Once created, a set [my variable] to (0) instruction is added to the leprechaun’s code. The programmer needs to use the drop down to change the variable that will be set to score.


At this point, students can be asked to consider when the score needs to be reset in a game. Looking at instructions in the Events category, they can determine which would be needed to start a set of instructions that changes the score to 0. The instruction when [green flag] clicked is an Events handler that is used to begin a program. So, the set [score] to 0 instruction should be placed underneath this Events instruction so that the score is reset each time the program begins.

Winning the Game

Now let’s think further. What is the purpose of having a score? What do we want to achieve by creating a score? In this program, we make a simple game despite having to write a larger amount of code than other elementary modules. The player earns a point for each coin collected, and, in order to beat the game, the player needs to collect 9 coins. In other words, when the value of the score variable is 9, the game is over.

To write this code, we use a wait until < > instruction from the Control category. This instruction pauses the code until a certain Boolean condition is true.

In the lesson, we add a wait until < > instruction to the when [green flag] clicked set of instructions as part of the leprechaun sprite’s code. Notice the elongated hexagon in this instruction, indicating we need an Operator here. The (0) = (50) instruction is added to the < > portion of the wait until < > instruction. The left bubble is replaced with the score bubble from the Variables category, and the right bubble is replaced with the number 9. The instruction now reads wait until <(score) = (9)>, telling the program to pause until the player has received 9 points, meaning the player has collected all 9 in coins. Once this occurs, we program the leprechaun to say “You’ve won!” In this program, students are learning multiple concepts related to variables, including how to change and use them in a program and the basics of Boolean logic.

Cross-Curricular Connections

There are a variety of ways in which this activity both teaches computer programming and allows for the use of skills from multiple academic areas. 

Mathematics connections are prevalent throughout the entire unit. Moving the leprechaun, as well as placing sprites (such as the various coins in each level) throughout the game in specific positions requires understanding of the coordinate plane. Plotting points and moving about the plane are concepts included in this unit. 

Simple math skills are exercised when determining the value of each coin and the total score of the game. Students needed to accurately choose a comparison operator when writing code that is intended to run until the game is over. When the score is equal to the total number of points accrued from collecting the coins, then the game ends. 

Art and design are part of this unit, as well. While the sample lesson utilizes Scratch backdrops that already exist, this lesson also teaches students how to edit a background using the Scratch editor. Students learn how to upload backdrops of their own, which could be images of designs they drew independently, or could include customizations they add while using tools in the editor. 

Language arts and literacy also play a role in this unit. When adding directions for the game to the backdrop of the main screen, students can and should be challenged to use correct grammar and compose the instructions in a way that makes sense to the user. Similar to this idea, when writing code, programmers must always be considering how to write a program using English words and phrases in a way that is understandable for other developers who might be working on the same project. Determining the instructions needed and the text that needs to be added to some of these instructions is a stepping stone to this concept of writing a readable program for other developers.

Basic music concepts are present in this unit, with the ability to increase the difficulty of these skills. Lucky Leprechaun primarily teaches students how to upload music for different levels. However, students could be further challenged to create their own music using the Sound or Music Extension instructions in Scratch. The Music Extension instructions require a basic understanding of music notes and tempo, as well as how they can be brought together to play a song. 

Finally, a bit of Social Studies or cultural knowledge is included in this game as it relates to St. Patrick’s Day. However, students can create a game that relates to any theme or concept of choice. This provides teachers or homeschool families the opportunity to incorporate programming with whatever theme is being studied. In actuality, many of Content Library Junior projects contain themes that can be adjusted to reflect the themes of others’ curricula. Parts of the program can then be customized. For example, educators might require students to create levels that accurately reflect a historic time period, a specific country, or a different holiday. So, even subjects like Social Studies are part of this unit.

Each of our units aims to engage students with interesting themes. We strive to incorporate multiple academic areas into programming units. For so long, academic subjects were and often still are compartmentalized during their school days. We think of Math time as strictly Math time, English/Language Arts time strictly for all things literacy, etc. Yet that doesn’t reflect how we solve problems in real life.  Therefore, it is imperative that students learn to utilize a combination of their skills to effectively complete a task. 

At the Excalibur Solutions STEM Academy, our goal is to provide all our students with a quality STEM education that emphasizes technology and engineering.  Each of our units includes cross-curricular content, and this provides our students the opportunity to see the benefits of combining their skills to achieve success.

Stay connected with news and updates!

Join our mailing list to receive the latest news and updates from our team.
Don't worry, your information will not be shared.

We hate SPAM. We will never sell your information, for any reason.

To learn more about how we can help you integrate STEM education at your campus or homeschool, contact us for a consultation. 

Schedule a Consultation