How I Built this Valentines Themed Heart Catch Game in Under 4 Hours
This week's ELH challenge was to build a Valentine's interaction.
I built three different ones (see below), but the last one was a game I built in under 4 hours.
In this article I discuss how it was developed in less than 4 hours.
I wanted to create a game where hearts fell from the sky and the unicorn caught them.
When I initially began playing with the idea, I couldn't figure out how to keep my unicorn from going off the screen. I didn't want to calculate where the unicorn was at any particular time because that just seemed like 'too much'.
I started thinking about how the various components available in Storyline work and I thought of Sliders. A slider has a starting value and an ending value. If you change the 'thumb' of a slider to a picture, then that thumb can't move beyond the limits of the slider.
How to Change Direction of the Unicorn
Changing the direction of the unicorn was as easy as changing the state of the slider.
Let's Get Things Moving
How do we make our unicorn move back and forth on the screen? We just change the variable which represents the Slider value. To increase the excitement, I created a variable called speed, which starts at 20 and drops each time there is a collision between the unicorn and a black heart (more on this later).
We will use a key press to determine if we want to move right or left.
Adding Game Elements
Now we need something for our unicorn to do, we want those falling hearts. Start by placing a heart off the screen and giving it a down-ward motion path.
Give the heart a couple of states and place its initial state as hidden
Animate the "yes" or collision state.
Now check for collision with the slider
Copy and Paste Your Work for More Objects
Now that we have the basic mechanics in place, we can just copy and paste our heart and spread it across the top of the screen using the "Arrange", "Distribute Horizontally" feature in Storyline.
What's the Score?
Now we need some simple triggers to adjust our score variable as well as our energy and speed variables.
Catch a red heart
Catch a black heart
That Was Random
Games shouldn't be too predictable, so I created a layer to randomly select which heart to activate (they drop automatically when their state changes to "normal")
This layer has a really short duration (< 1 second) and is set to close when it reaches the end of the timeline. It displays nothing, just chooses which heart to change to normal, then closes.
How Am I Doing?
The levels change when the player reaches 200 points and 500 points.
The "Game Over" layer is shown when the energy level drops below 10.
This is how I rapidly designed this simple, but fun game. You could use the same format to create almost any type of game in Storyline.
Learn More? Check out the Storyline file!
My other two Valentines demos for this week