Axure HQ here, back with another project from the “Fun with Random” series, which include projects like Grub Guess, Roulette, Spot the Difference, AxZee!, and of course the classic Rock Paper Scissors Lizard Spock.
It’s simple. Type the words and they disappear. Try and get the highest speed or the most points as you can. You’ll lose HP if the words get to the bottom of the screen so don’t let it drop to zero. Don’t forget to press ESC for Word Bombs or ALT for Time Bombs when it gets difficult; they really come in handy!
It actually wasn’t so simple. The words are falling in a loop interaction taking advantage of “Loaded” and “Fire Event.” The speed is controlled by a global variable “WordSpeedVar” and is affected by other factors like difficulty or Time Bombs. Matches are made when the text field input matches the word’s text. “MatchVar” variable is matched and a random word is selected from the repeater list. The list then outputs the corresponding number and replaces the text onto the word. Other actions are carried out affecting the position, speed, points, and match variables. HP is lost when the word’s bottom Y position is greater than a set value.
Matching words with different values in addition to replacing that value with a randomized new word, I had to create a new case for each word. This resulted in five instances of match cases in the text field input as well as five instances of the word. There is probably a way to consolidate the redundancy but because I only used five instances, I figured brute forcing my way through this would not be too troublesome. The variables include the number to distinguish which corresponding instance it is affecting. For example, “Word2Var” or Word4Var".
For an even more in depth break down of how the matches are made, let’s start with the text field input. When the text is changed and it matches the text on the word “Word#Rect/word”, variable “MatchVar” is set to “match#”. Once the variable matches, “Word#Rect” sets the variable “Word#Var” to
[[Math.floor(Math.random() * WordsDataCount) +1]]
This basically chooses a random integer between 1 and number of rows in the repeater’s dataset. The repeater’s dataset include a list of words and the row number. There is a “dummy” event which moves the repeater’s item “word item” by (0,0). This event is utilized in order to access the contents of the repeater internally. Once the repeater’s item is moved, it accesses the random number through “Word#Var” and selects the corresponding text through “Item.Number” and “Item.Var”.
Losing Lives and Good Game
Your life/HP bar goes down when the Y value of the “Word#Rect” bottom gets to a certain value. This causes LivesVar to decrease and “Lives Text” widget to change. There is an animation here that flashes a “Life Lost” widget on the canvas that acts as a hit marker in addition to shrinking the “HP meter” widget. Of course, once the HP reaches zero, it links to the game over page and carries some global variables over to display as player achievements.
Putting Power Ups
The two features, Time Bombs and Word Bombs, are activated within the text field input using the conditional “Key Down” of the Escape key and the Alt key. When Esc key is pressed, “MatchVar” is set to “match#” five times for each instance of the word. Because the simultaneous setting of “MatchVar” to different values causes conflicts, I included “wait” actions to allow time to carry out each value change. When the Alt key is pressed, I set “WordSpeedVar” to divide by nine in order to scale the speed down proportionately for five seconds. The speed is multiplied by nine to resume speed. As the timer goes up, power ups are given in time intervals by using [[TimeVar % PowerUpTimeVar]] equals 0. “PowerUpTimeVar” is determined by difficulty chosen.
Of course not everyone has a WPM over 100 so I had to include difficulty levels. When a difficulty level is chosen, four variables are changed: “AccelerationVar”, “StartingSpeed”, “LivesVar”, and “PowerUpTimerVar”. “AccelerationVar” is tied to the points and adds to the “WordSpeedVar” for every point that is gained. “StartingSpeed” sets “WordSpeedVar” to determine the initial word falling speed. “LivesVar” is straightforward and sets your HP. “PowerUpTimerVar” is a time interval in seconds to give Time Bombs and Word Bombs.
Starting with the concept of a widget falling at a certain rate, the first thought that came to mind was a loop interaction. However, I needed to reset the word once it reached the bottom. This nested loop interaction took me a few unsuccessful tries to finally get to work. I needed to include an interruption to the nested loops if a match was made. I settled on conditional logic within the loop interaction using a master with raised events. The “Loaded” interaction has three conditional logic of match made, life lost, and fall speed.
Another problem that I encountered was how to access the items within a repeater’s dataset through a different widget. Discussed above and thanks to Alyssa_Axure, I was able to use a “dummy” interaction that moved the repeater’s item by (0,0). The repeater’s item then had conditional logic that would change the text corresponding to the randomly selected row number.
Throughout the project, I discovered the possibilities of Axure RP in addition to it’s limitations (as a game engine). I was able to appreciate the countless hours of work that goes into game design or user experience. I learned how to tap into the power of global variables instead of brute forcing all of the values in order to make a robust and dynamic experience. Lastly, this project was just overall really fun to make and I probably ended up playing it as much as I worked on it. I hope you enjoy it too!
And if I don’t see ya… good afternoon, good evening, and goodnight!
Proto-typer.rp (158.8 KB)