Professional Documents
Culture Documents
AP Comp Sci
AP Comp Sci
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.