Lab 17
In lab 17 we had to create a very famous game that settles everything, its rock, paper and scissors. In order to first start the lab i created 3 buttons on top for each representing entity in the game, the rock, the paper and the scissors. After this I used to css to make them look nice and pretty by giving them background images and text on top to know which is which. After this i added 3 lines of text. One that says "your throw", another that says "cpu throw" and finally the "winner". These 3 lines of code is what will change every time you throw a rock, paper or scissors. Each line will change corresponding to who wins and what beats what. The code for this used javascript to create the game. Entirely it was a function with a bunch of if codes and document.getElementById because it was a repeated set of commands to see if your throw
would win or not. As a web designer i wouldnt use this in a site unless you want to make a quick game
but it is useful for a game designer to understand how to make a function with if commands.
Comments
Post a Comment