GithubHelp home page GithubHelp logo

kksy / wdi-project5-pokehunt Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.2 MB

WDI Project 5: Node.js treasure hunting game with real-time location update

Home Page: http://pokehunt.herokuapp.com/

JavaScript 3.84% CSS 96.16%

wdi-project5-pokehunt's Introduction

PokéHunt

Overview

PokéHunt is a game based on the Pokémon series. It features Google Maps API and the use of geolocation to simulate player adventure to catch Pokémon surrounding the map.

This app is not only limited to Pokémon, but the code can also be used in other forms such as treasure-hunting-type games.

This project was made during the final 5-day project week (14/12/2015 - 18/12/2015) as a Web Development Immersive student at General Assembly.

Live Demo: http://pokehunt.herokuapp.com/

  • username: user1
  • password: password123

Disclaimer

No copyright infringement intended. Pokémon is owned by The Pokémon Company, which I am not affiliated to.

Features

  • Geolocation with automatic position update
  • Ability to click on Pokémon Markers
  • Ability to save Pokémon in a modal pop-up collection
  • Made for mobile
  • [UPDATE 16/01/2016] User login and signup

alt text

Technologies

Design Process

Wireframes

alt text

Database

alt text

Limitations

  • [FIXED ON 16/01/2016] Only one user
  • Geolocation high accuracy not set up
  • Live demo has Pokémon markers set in Melbourne CBD only
  • One Pokémon can be caught multiple times i.e. no restriction
  • Associations in Sequelize not working

Remarks and Improvements

  • The minimum viable product for this project was to use Google Maps API to help in creating a real-time treasure hunting game. As my goal for this project was to practice more Node.js and incorporate a database with it, I only planned to have clickable markers once a player reaches a certain area. These markers can then be saved in an inventory. Future improvements include fixing limitiations.

  • This was my first time using Sequelize, and I had difficulties with creating associations. I wasn't able to get it working, so I had to get half of the user_pokemon table in order to access the pokemon table's image column. The code would have been cleaner had the associations worked.

  • I used Ajax calls as an alternative in accessing server data. Another way to do this is to use res.render() in the /game route to make the data available on the client-side through a variable. However, due to the asynchronous behaviour of Node, I was only able to get one out of the multiple I needed.

Installation

This is for people who would like to use my code to make a treasure hunting game using Google Maps API:

  1. $ npm install once github repository is downloaded
  2. Get a Google API key and replace the placeholder text in /views/partials/geolocations.ejs or create a .env file in the root of your project folder. This works as /routes/game.js renders a variable API_KEY: process.env.GOOGLE_API_KEY.
  3. Install PostgreSQL and create a database for your app
  4. Change the database information in /server/config.json
  5. $ node_modules/.bin/sequelize db:migrate to run the migrations and create tables in your database

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.