Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

a. My program in an interactive game that I have fabricated through the app code.org.

The
purpose of my game was to create something survey-like as many people like meme
surveys and to also have funny results after completion. The video I have submitted
shows two results after answering yes or no on whether you would like to feed the horse.
If yes is selected a good response shows but if no is selected a bad response shows. I
credited all sources of images to avoid plagiarism. My code is similar to that of others
due to it being a limited survey format but it's different in its results once you answer.

b. I wrote this program designed for people who like to do surveys and I added a funny
subplot to go along with it. My first problem came when trying to make the buttons
responsive when clicked. I later found I had mixed up the setscreen options and had to
relabel everything again. Another issue came when I had started to make the dropdowns
as the screen would not change to another screen when the options to change the
screen can be selected through the game. I had to change the dropdown names to just
dropdown1 and dropdown2 to get it to change screens from the homepage to the survey
page. Both of these problems were single handedly solved and were pretty simple to
navigate through. Other than that I had a lot of fun and a great opportunity to do a
simpler more fun game.

c. });
onEvent("dropdown1", "change", function(event) {
if (getText("dropdown1") == "screen2") {
setScreen("screen2");
}
});
onEvent("dropdown2", "change", function(event) {
if (getText("dropdown2") == "Home") {
setScreen("Home");
}
});

In this game/survey “hungry horse” the user must first change the screen by clicking the
dropdown and selecting screen2. Once that is done, the user must decide whether to
feed the horse or let the horse starve. Once an option is selected, a response will follow
based on what the user has answered. The code to change the screen was a simple
dropdown option for the user to change the homepage to screen2, or the survey page.
This was done by getting the dropdown1 equal to screen2 and once that had happened,
the screen was set to screen 2. The same was done for the final pages after the user
has responded but in reverse, going from dropdown2 to the homepage.

d. onEvent("button1", "click", function(event) {


if (getChecked("Yes")) {
setScreen("Yesssss");
} else if ((getChecked("No"))) {
setScreen("Nooooo");
} else {
My code uses abstraction as it condenses codes that may repeat or may be long into
smaller chunks. The codes are easy to understand and read. When the survey is clicked
through the dropbox it takes the user to the screen page. Once yes or no is selected it will take
the user to another page. Selecting the dropboxed takes you back to the survey and home page
as this function is called on many times to send the user back to choose the second option if
they so choose. My code did not require many abstractions as it is relatively short and easy to
craft but adding these dropboxes did make it easier to go through the pages easily and to set
the screens to my choosing. More code would be needed if I did not do this.

You might also like