+ 2
Outlining such a plan for a project is very helpful, isn't it?
Your code looks really good now. I have answered your questions where I have changed something.
https://code.sololearn.com/WtX6fSaAkjkR/?ref=app
+ 1
By the way Your Mom , I recommend a different approach.
- Generate two numbers
- Generate one operator
- etc.
+ 1
Operator is randomly selected from the array. This is only its character. With switch is determined its function and finally the actual result of the task.
+ 1
Your test if(wrong < 1) ⊠is never called.
If you remove live and you donât have any then comming the error.
The best method is to write what should the code do and when. With paper and pencil. After that it will be more easier to code.
Here a image with beginning of that what I mean:
https://dl.dropbox.com/s/tz3qo31payo37f8/Algorithm.001.jpeg?raw=1
+ 1
The idea how to change a shadow of a button in this way is ok, but the css with javascript donât so work and all depends from used browser too. In addition a part of people work with touch screen devices. To find out a solution which good works you need to develop and test some different ways. More to this in the code.
To restart the whole thing you have to as you said yourself, after you reach 0 lives, to set all elements to the state as in the begining of game. For it I would recommend you to repeat the css tutorial or close additional one more for example with responsive design etc. Because there will be needed more structure in the design of the page. Now a few elements i do not see because they are out of window. For this reason I used the previous code to show the way for shadow:
https://code.sololearn.com/WuRF2E01WSME/?ref=app
+ 1
There is a coma after the bs1 variable declaration, therefore the second belongs to the same âletâ.
+ 1
I didnt test that yet on a PC, does work the shadow() with onload (itâs important) on your PC?
+ 1
Ohh sorry, I see now the mouse events listener at the end of the code were wrong called. Now works the on/off of shadow with mouse down/up also on PCâs with mouses:
https://code.sololearn.com/WuRF2E01WSME/?ref=app
+ 1
Your Mom in my opinion on a PC is quite inconvenient first type the answer on keyboard and then click with mouse on button. It would be recommended to use the Enter key for submiting the entry. Try to implement it on your own, of course if you like it.
0
For example in this way:
https://code.sololearn.com/Wlt5l75KfwcD/?ref=app



