+ 2
Ideas for improving JavaScript game (Minesweeper)
I made Minesweeper as my first JavaScript project: https://code.sololearn.com/Wo6A070fm13c/?ref=app I don't know much about JavaScript so I thought I'd ask you for ideas on how to improve it. I think it's annoying having to change the mode for flagging or uncovering (only on the phone, you can use right-click on desktop computers), in some browsers you can press and hold, but it doesn't work in SoloLearn. Is there a touch-event or something that I could use for pressing and holding also in SoloLearn?
11 Respostas
+ 16
Fix this:
SyntaxError: unexpected end of input Line: 6.
+ 13
Unexpected token =
Line 451
+ 13
It's nice... Improve CSS centering a bit.... ^_^
+ 13
Here.... Try this :
body{
background: #505055;
color: #fff;
font-family: sans-serif;
font-size: 1em;
text-align: center;
margin:0;
overflow:hidden;
}
.settings {
background:#404045;
}
body * {
border-radius:5%;
}
^_^
+ 12
Uncaught SyntaxError
Unexpected token =
Line 129
^_^
+ 2
Thanks for all your help! It looks nice!
I modified it a little bit, for example the overflow thing causes the canvas to disappear on small screens
I'm also currently changing the button to switch the action, it's still WIP, but I already saved it
+ 1
Strange, it works fine for me. In line 6, I'm only declaring variables, in line 129 I also had an error before but I saved it after fixing it...
+ 1
@ValentinHacker Ah I think I found what could have caused the error, should now work
+ 1
One issue is that both green of the number 2 and the background of game when someone win are the same color tone. The second is that you can put 0 to X and Y, a number higher than 2 should be the minimum.
One tip that I can give you is to put a function to open all squares around when you click in a number and you put all the flags that you needed like the Minesweeper that comes in Windows 7. Another tip is to put another function to not allow the user to put more bombs than tiles in the game, another to automatically decrease the number if the tiles is decreased when the player is adjusting the game and if he increases it the bombs increase proportionally.
0
@ValentinHacker I guess I fixed line 451 but I'm still confused where you're seeing these errors
0
@ValentinHacker Thanks :)
I will try, but I basically know nothing about CSS, only what I used in the code, so I'm gonna start the CSS course now ;)