Monster Match is a webapp that utilizies JavaScript, Ruby on Rails, HTML, and CSS.
Monster Match was a challenge I gave myself that incorporated two of the major topics we covered in Mod3: working with event listeners, authentication, authorization, and challenged my understanding of CSS Flexbox.
- JavaScript
- Ruby on Rails
- HTML5
- CSS
From there, open two terminal windows. In the first, navigate into the folder titled full-snack-backend and run
rails s
in your terminal.In the second terminal window, navigate into the folder titled full-snack-backend and run
lite-server
This should prompt your browser to open a page at:
localhost:3001
You are now ready to start playing Monster Match! 👻
Once you have opened the project through lite-server, you have the option to Sign up,Login, or play as a guest!
Move your first Monster to begin the game! Keep track of your high score by creating an account or signing in!
Authenticating Users:
class AuthenticationController < ApplicationController
skip_before_action :verify_auth, only: [:login]
def login
@user = User.find_by(username: params[:username])
if (@user&.authenticate(params[:password]))
@token = JWT.encode({
user_id: @user.id,
exp: 24.hours.from_now.to_i
}, Rails.application.secrets.secret_key_base)
render json: {token: @token}, status: :ok
else
render json: {message: 'Login credentials not found'}, status: :unauthorized
end
end
end
Game Over and Posting Personal High Score:
function gameOver(turnCount) {
if (turnCount === 0) {
board.innerHTML = `
<div class="game-over-container">
<img id="game-over-image" src="images/game-over.png" alt="Game Over">
</div>
`
if (score > highScore) {
highScoreboard.innerHTML = `${score}`
localStorage.setItem('highScore', score)
}
}
}
Free Matches + Points Message:
New Game:
Sign up and Login Previews Coming Soon!
- Create an account.
- Play a game
- See remaining moves
- See total points
- See personal high score
With time, we would like to refactor my code utilizing more iterables, update login and sign up pages, and add features such as:


Coming Soon!