Jump to content

[Phaser] Minesweeper


fabricator
 Share

Recommended Posts

Hello friends!

Here is my first Phaser game -- Minesweeper.

 

Game: http://blog.francis.wang/minesweeper/

Source: https://github.com/go717franciswang/phaser-ms (Because I am still learning Phaser and Google Play game service API, I was experimenting with a lot of things. As a result, the code base was a horrendous mess :()

feature-graphics.PNG

 

I chose to remake minesweeper because it is one of my favorite games, and it has simple logic. I used Google Play game service to enable persistent leaderboard and achievement.

Some difficulties I had during development:

  • I didn't have a good way to listen for simultaneous left and right mouse button click because onInputDown would only trigger one time when both buttons are clicked at the same time. My workaround was whenever onInputDown was triggered, game engine checked if the other button was clicked around the same time (https://github.com/go717franciswang/phaser-ms/blob/master/js/play.js#L192).
    • Just found out this doesn't work on all browsers. Looking for a more reliable way to solve this.
  • I tried to add Google Play game service event tracking for the number of clicks, flags, wins, etc to show some interesting stats in the achievement page. The Google API did not allow sending event data once per game because each game window may be too short or too long to be a valid API request. So I wrote an event manager that sends new data every 60 seconds (https://github.com/go717franciswang/phaser-ms/blob/master/js/gapiEventManager.js).

 

 

I welcome all feedback, and am looking forward to making more Phaser games!

 

Francis

Link to comment
Share on other sites

Really cool! The google+ integration worked fine, and the leader board is a nice touch. The game itself was a good replication of minesweeper but I missed the scared face when you left click on an unknown space. The graphics are a bit ugly in my opinion, mainly because of the smoothing. Overall though a really nice implementation of an online minesweeper :)

Link to comment
Share on other sites

Hey vec! Thanks for your kind words. They are very encouraging! I completely forgot about the scared face. I'll try to add it next.

I am a pretty terrible drawer, especially with Gimp. I tried to turn off smoothing with 

game.stage.smoothed = false;

I guess that didn't do the job. Do you know a good way to turn off the smoothing?

EDIT:

Just found an example: http://phaser.io/examples/v2/display/render-crisp#gv. It mentioned the following:

//  Or across the whole stage, like this://  game.stage.smoothed = false;

uncommenting the 2nd line didn't pixelate the melon in the game, but when I add

melon.smoothed = false;

It did the job. So maybe game.stage.smoothed is buggy  :unsure: .

EDIT2:

moved game.stage.smoothed = false to the preload function, now smoothing is successfully disabled.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...