Sei sulla pagina 1di 2

2a.

League Helper is an app created in MIT App Inventor and its purpose of the app is to
display information about every champion in the game League of Legends. We used the
Riot Games API to display statistical information through our website,
botlanehelper.weebly.com. When the app first loads, there is a main page with 5 buttons.
Each button goes to a different page of champions divided into the categories of Top,
Jungle, Mid, AD Carry, and Support. Clicking on a button will take you to a page with
a picture of all champions in that role. When a champion button is clicked, all other buttons
are hidden and the individual champions page on our website will be displayed in using the
webviewer feature. Winrate, playrate, banrate, tier, and masteries are all displayed on the
site. Tier is how the champion is rated compared to the other champions in their respective
role. S is the highest, then it goes A, B, C, and so forth all the way to F. For all
champion roles except for support, matchups can be simulated. A random fraction between 0
and 1 is used. If the number is within the winrate of the champion, the matchup will be won, if
the number is greater than the winrate, the matchup will be lost.

2b. The first major problem we ran into was trying to connect the Riot Games API into our
app. I some experimentation, I found it was too difficult to actually host the API in our app,
plus the file would be massive. My partner Joey suggested creating a website and then hosting
the API through there. Then, we would use the webviewer to call the website page to display
the stats. Weebly was chosen as the site creator because I have experience working with
website editor. The second roadblock was a very unfriendly UI. The UI was not user friendly
because the use would have to scroll past all the champion buttons in order to find the web
viewer. I thought that removing the buttons from the app would be so I could access the web
viewer could really polish the UI. I found that making the buttons invisible was the best
solution. I created a procedure that made all buttons that were not necessary invisible when a
champion button was clicked. This way, the web viewer was in an easily accessible spot. I also
added a reset button that makes all the buttons visible and stops the web viewer from
displaying a web page.

2c. This section of code represents the algorithm for simulating a matchup. It uses the random
fraction generator component. It uses both mathematic and logic through an if/else
statement and an inequality. When a matchup button is pressed, a random fraction is
generated. If it is equal to or below the winrate of the champion, it is considered a win, if it is
higher, it is considered a loss. A variable is used in order to input the winrate. This way, the
code is easily duplicatable.

2d. For our abstraction, we had incorporated a procedure that makes loading the correct
URL for the champion page much more efficient. These abstraction calls the webviewer and
makes the URL a variable. This way, different URLs can be changed for each page. The
procedure also calls the hideall procedure. This procedure hides all of the other buttons and
matchup buttons except for the webviewer and MatchupLabel. Matchup Label is needed
so the result of the matchup simulation can be shown.

Potrebbero piacerti anche