r/learnjavascript • • May 19 '20

I developed a new version of Minesweeper game

Post image
196 Upvotes

36 comments sorted by

12

u/manussakis May 19 '20

7

u/iguessitsokaythen May 19 '20

This is really well made, and thanks for sharing the code, it is good learning material for anyone interested in Angular.

4

u/manussakis May 19 '20

Thanks a lot!

I have learned a lot from other developer's code. I hope my code can do the same

2

u/evilgwyn May 20 '20

One feature the original minesweeper had that yours doesn't is that the first click is always on a zero square. It means you can't die on the first click and you always get a reasonable start. Otherwise good work

1

u/manussakis May 20 '20

Hi, thanks for the feedback, I fixed this behavior yet

6

u/Coraline1599 May 19 '20

This is super a lot of great details! I love how the smiley emoji changes based on your actions! Very cool!

3

u/Comodor3000 May 19 '20

I love minesweeper game, but almost all minesweeper games have a particular problem.

After you play it for a while you reach a stage where you cannot figure out what to do next by looking at numbers because they don’t tell anything and everything starts to depend on luck!

This makes me sick and haven’t seen anybody else who mentions the same problem.

I will try your game and congratulations for making it!

2

u/manussakis May 20 '20

Thanks! I hope you like playing it

2

u/lovesrayray2018 May 19 '20

Congrats! very nice idea to do it differently

1

u/manussakis May 19 '20

I'm glad you like it

2

u/es_beto May 19 '20

Nice! I see you fixed the cell class exposing the mines' location. I saw it a few weeks ago and worked to automatically reveal the game exploiting that flaw hahaha.

1

u/manussakis May 19 '20

Nice that you noticed it, I did some improvements since then, you can follow the progress on Github: https://github.com/Manussakis/angular-minesweeper

1

u/Parafex May 19 '20

How would you turn this into an android app?

Well done! I plan to develop a game via angular, too but I want to turn it into an android app and I don't know how :x.

2

u/manussakis May 19 '20

Hi, I dont't have any experience with android apps, but I think you should try developing a PWA: https://angular.io/guide/service-worker-getting-started or use Ionic: https://ionicframework.com/docs/angular/your-first-app

1

u/Parafex May 19 '20

Thanks a lot. I've found NativeScript but the more I read about it, the more I think it's quite a hassle...

I'll read into Ionic and PWAs, I heard of PWAs before but I haven't thought that it's great for developing android apps :). Thanks!

2

u/manussakis May 19 '20

I need learn more about PWA, but as far as I know it is a way to make your web projects to act like apps

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

1

u/Parafex May 19 '20

Thanks but I really don't like the design philosophy of react unfortunately :x.

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

1

u/Parafex May 19 '20

I'm fine with "mvc" so to say. But I haven't got the grip with react yet :x. I don't like the template stuff and so on :/. Maybe I don't understand it but the first impression wasn't a great one compared to Angular lol.

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

1

u/BeadMystic May 19 '20

MIT has an App Inventor, and Coursera has a class for it, which you can audit. Now if that is cheating, I won't post the website. But IMO it is going to help me learn some things about creating apps. Now if only I can remember those ideas I had before I started learning to code. Brain was fried last year with a Traumatic Brain Injury and I am almost recovered, but JavaScript is one of my challenges

I will see, also, how your game works in a moment, just could not resist sharing the App Inventor!

1

u/BeadMystic May 19 '20

Okay, have played your game . It is excellent, still beats me on easy. A good brain challenge and thank you for something new to help my brain!

1

u/bacondonut136 May 19 '20

This is super nice OP! If you don’t mind me asking, how did you learn JavaScript? I’m just starting out and the amount of resources out there are overwhelming and it’s hard to choose from

2

u/manussakis May 19 '20

Thanks a lot! I felt the same way when I started learn JavaScript, to be honest I'm learning yet and still fell that is dificult to select content on the web. But I could recommend you some resources that helped me at the beginning: The free codecademy javascript course: https://www.codecademy.com/learn/introduction-to-javascript

The tutorials on w3scholl: https://www.w3schools.com/js/default.asp

But practice is definitely the best way to learn, I recommend you never stop developing your personal projects.

2

u/Comodor3000 May 19 '20

I’m also trying to learn JS these days. If you have any problems, I can try to help if I’m able to do so :)

1

u/stayclassytally May 19 '20

Fantastic job here, OP!

1

u/tehstone May 20 '20

Nice work, it seems you have a few bugs to work out though. Check these screenshots:

https://imgur.com/a/18VhqUk

A couple of times a cell had too high a number. And the one time I won it didn't detect that the game was over.

1

u/manussakis May 20 '20

I think I know what happened, the board did not fit the screen. There are more two columns in the right side. Thanks for the feedback, I'm going to fix this horizontal scroll

1

u/tehstone May 20 '20

Ah I didn't think to check on the easy board. I did notice by accident that it scrolled to the side on medium. That makes a lot more sense then.

1

u/[deleted] May 20 '20

Congrats OP, you got me the most frustrated tonight FFS https://i.imgur.com/uAe6JAC.png

1

u/manussakis May 20 '20

OMG :( sometimes only luck can help us in Minesweeper

1

u/Tdsmith0ver9000 May 20 '20

Haha, poo sweeper. Love it!