Build homes, communities and hope through a virtual house-building game that mirrors the experience of physical volunteering programmes.

Overview

Habitat Heroes

Note: The current house building time and quiz reset time have been shortened for the purpose of allowing users to try out more features in the MVP.

What it does

Habitat Heroes is a virtual house-building game that mirrors the experience of physical volunteering programmes. There are 6 main features that the game supports:

  1. Simulate a virtual house building experience
  2. Update players on news & latest events
  3. Quiz players on housing issues
  4. Provide daily quest challenges
  5. Allow sharing of game experience on social media
  6. Allow donations via purchasing in-game currency

Demo Video

Habitat Heroes Demo

Requirements

Node.js is required to install dependencies and run scripts via npm.

Available Commands

Command Description
npm install Install project dependencies
npm start Build project and open web server running project
npm run build Builds code bundle with production settings (minification, uglification, etc..)

Writing Code

After cloning the repo, run npm install from your project directory. Then, you can start the local development server by running npm start.

After starting the development server with npm start, you can edit any files in the src folder and webpack will automatically recompile and reload your server (available at http://localhost:8080 by default).

Deploying Code

After you run the npm run build command, your code will be built into a single bundle located at dist/bundle.min.js along with any other assets you project depended.

If you put the contents of the dist folder in a publicly-accessible location (say something like http://mycoolserver.com), you should be able to open http://mycoolserver.com/index.html and play your game.

Using Redux

Using existing actions

store.dispatch(setName('Hello'));

Fetching state

const selectName = (state) => return state.user.name;

const name = selectName(store.getState());

Subscribing to state

Example based on Redux's own example on their website:

const selectName = (state) => state.user.name;

let currentName;
const handleNameChange = () => {
  const previousName = currentName;
  currentName = selectName(store.getState());

  if (previousName !== currentName) {
    // Handle name change
  }
};

const unsubscribeToNameChanges = store.subscribe(handleNameChange);
unsubscribeToNameChanges(); // to unsubscribe

Defining your own reducers

Using @reduxjs/toolkit, reducer and action definitions have been greatly simplified. You can just create a "slice" of the state for a particular domain.

See reducers/userReducer.js for more information. One key thing to note is that you can directly mutate the state in the reducers - @reduxjs/toolkit will help to translate those mutations into immutable operations.

Note that Redux state is currently being persisted into the browser's cache. If you want to exclude a specific property from being cached, you can check out blacklists for redux-persist.

Comments
  • Add villagers

    Add villagers

    Basic Hut Villager:

    https://user-images.githubusercontent.com/43816143/158112692-84345de6-3848-4b54-9dde-5f59eec5def3.mov

    Brick House Villager:

    https://user-images.githubusercontent.com/43816143/158112955-ad73cc09-9838-4399-a848-e3ed69edb397.mov

    Concrete House Villager:

    https://user-images.githubusercontent.com/43816143/158113028-684e85e9-df66-4d88-bac0-af67e344ea79.mov

    opened by haveaqiupill 3
  • Add DonateScene.

    Add DonateScene.

    Users click on the original coin button to enter the DonateScene where they can click donate money buttons to earn game coins. A faked Stripe payment page will appear and after confirmation, coins will be added to their game accounts.

    https://user-images.githubusercontent.com/45040630/158092097-4409a88b-de06-4bcd-bc52-0157ac3ea5f5.mp4

    opened by WANG-Yuchen-Alice 2
  • Add social media sharing links.

    Add social media sharing links.

    1. Sharing page layout.
    Screenshot 2022-03-11 at 11 52 06 PM 2. Add sharing links to the 5 platforms: FB, Ins, Telegram, Whatsapp, Twitter. 3. TODO: 1) better content (currently it's only a screenshot of our main page uploaded to ibb 2) a better photoboard
    opened by WANG-Yuchen-Alice 2
  • Add final features, see videos in PR

    Add final features, see videos in PR

    Decoration Placement

    Users will now see a coloured tile below hinting whether it is possible to place down a decoration. Placement is also now along fixed isometric tiles. Users will also be prevented from placing down decorations where there are existing decorations or other geographic features that should logically prevent placement.

    https://user-images.githubusercontent.com/45617494/159096519-f900d7ec-a224-4678-9e3a-a39711b9f906.mov

    User Walking

    User will now collide when walking into an area that isn't walkable.

    https://user-images.githubusercontent.com/45617494/159097021-8f64ed74-5d27-424f-bf19-f91b2715f77d.mov

    House Building

    User no longer directly clip into the house when building, though he is allowed to walk through other stuff (to prevent users from adding decorations and preventing building altogether)

    https://user-images.githubusercontent.com/45617494/159096405-75d0a87b-f168-4127-9b9a-d492ce665ada.mov

    opened by zhuhanming 1
  • Add quests

    Add quests

    Couldn't demo everything due to file size limit.

    https://user-images.githubusercontent.com/45617494/158097780-bd4a7ed1-40c8-4673-98e3-bb1ce75e0d9e.mov

    opened by zhuhanming 1
  • Add avatar panel

    Add avatar panel

    Added avatar panel + removed dependency on WebFonts, which was causing issues + is unnecessary since the font is now loaded directly via head tags in the index.html.

    Screenshot 2022-03-12 at 1 17 09 PM
    opened by zhuhanming 1
  • List of SFX required

    List of SFX required

    • [x] General BGM
    • [x] Welcome BGM (if we want a separate BGM for the login scene)
    • [x] SFX when user is typing their name
    • [x] SFX when user maxes out the number of characters and cannot type anything else (like a dull thud)
    • [x] SFX for hovering over buttons
    • [x] SFX for clicking buttons
    • [x] SFX for walking
    • [x] - SFX for opening up menu panels, e.g. clicking news
    • [x] SFX for successful purchase, kinda like coins clinking? Or like ka-ching
    • [x] SFX for building (might want to have different sounds)
    • [x] SFX for placing down trees
    • [x] SFX for placing down rocks
    • [x] SFX for correct/wrong option selected for quiz
    • [x] SFX for completing quiz + getting money
    opened by zhuhanming 1
  • Shop feature

    Shop feature

    • Fully implement shop feature
    • Refer to tele video for demo
    • Currently I'm using the tree spritesheets as the purchasable items, but this can be changed in the utils/item.js file
    • The tree spritesheet is kinda bad since each item doesnt have the same size
    opened by seeziyang 1
  • Add UI for coins

    Add UI for coins

    • Add reducers for coins
    • Add reducers for inventory
    • Add UI button for coins, feel free to change it to add the coin circle in front or smthg HAHA ps i dont have photoshop
    • Currently, clicking the button will increase the coin amount, this is just for testing the reducers, maybe next time it can open a UI to buy more coins or something
    • No idea why the person move to top right when I click on the coins button tho oops
    • Video demo on tele cos its too big to upload here
    opened by seeziyang 1
  • Create Avatar

    Create Avatar

    • Enabled the avatar to be controlled by the WASD keys

    https://user-images.githubusercontent.com/43816143/157458406-298ea259-7847-43f3-8377-5209fa6b7f54.mov

    opened by haveaqiupill 1
Owner
Habitat Heroes
Build homes, communities and hope through a virtual house-building game that mirrors the experience of physical volunteering programmes
Habitat Heroes
Network physical synchronization model room based on babylonjs + ammojs

Network physical synchronization model room based on babylonjs + ammojs The red mesh calculates the physical effects locally of the current user, and

蔬菜土豆泥 8 Nov 19, 2022
A progressive web app to help volunteers track their volunteering activities, register vet concerns and log incident reports.

POOPS - Pets of Older Persons 2022 Introduction This is a Next.js project bootstrapped with create-next-app. Getting Started First, install yarn: npm

Coders for Causes 17 Jan 3, 2023
Tiny website for previewing the ballot papers (house and senate) for Austalian federal elections

AusBallot Code for https://ausballot.netlify.app/ The AEC (Australian Electoral Commission) has this page to view all the candidates for an upcoming e

Robin Stocker 4 Jun 1, 2022
Programmers House api official wrapper

programmershouse-wrapper Programmers House api official wrapper Install: npm install programmershouse-wrapper Example of using: With .then //importing

Raid 2 Mar 23, 2022
A social network to connect web3 users and their communities.

Introduction This project is built using react, tailwindcss and Moralis (documentation) for our backend. We are also heavily using the built-in Morali

null 8 Jan 5, 2023
Stays: book accommodation on-chain, pay in crypto, and help local communities

Stays: on-chain bookings Installation Make sure you have node and nvm installed: nvm use v16 npm install -g yarn npm install -g lerna yarn install ler

Winding Tree 8 Jun 2, 2022
👨🏼‍🎨 It is a virtual blackboard, where you can make 🖌 drawings through 🖱 the mouse. You have the option to choose 🎨 colors and line thickness.

????‍?? Lets Draw ?? ÍNDICE 1. Lets-Draw 2. Realization of the Project 3. Technologies used 4. Authors 1. Lets-Draw ????‍?? It is a virtual blackboard

Rosamaria Rodriguez 2 Mar 7, 2022
A mesh network that connects remote communities to emergency responders without relying on internet, cell towers, or satellites

A mesh network that connects remote communities to emergency responders without relying on internet, cell towers, or satellites. Winner of Hack the North 2022. ??

Alice Cai 4 Sep 23, 2022
fardin 8 Oct 18, 2022
A contact app built with Solid.js, Vite, Hope UI and Typescript.

Solid Contacts Solid Contacts is a contact app to learn more about concepts like Solid.js (router / store / resources / reactivity), Vite and Hope UI.

Berkay Cimsir 2 Sep 21, 2022
This is my first attempt in creating a mern stack ecommerce website. Hope you like it!!

MERN E-COMMERCE PROJECT Hi! My name is Suhrrid Banerjee, This is my first attempt in creating a MERN stack e-commerce website. Prerequisite Nil Env Va

Suhrrid Banerjee 1 Jan 8, 2022
A SolidJS template built with Hope-UI

solid-hope-admin 名称 简介 solid JavaScript框架 hope-ui UI组件库 solid-app-router 路由 vite-plugin-pages 自动生成文件路由 query-string 解析URL地址 steeze-ui/solid-icon 图标 功能

null 9 Dec 13, 2022
A new way to share your readings with friends. Hope you like it!

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Gardenia Georgia 4 Sep 9, 2022
Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines.

Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines. A timeline is a collection of links that share a common topic or a journey of building and learning something new. Users can create timelines, share them publicly, and explore resources.

Students' Web Committee 14 Jun 13, 2022
Using a RPI 3b+ to create a PT camera accessible through Windows browser and controllable through MQTT

web-camera_PT A Web flask server converts the MJPEG stream from RPI to JPG img using opencv, then display in browser. Controls added to move Camera in

null 11 Dec 20, 2022
An implementation of the Dungeons & Dragons 5th Edition game system for Foundry Virtual Tabletop

An implementation of the Dungeons & Dragons 5th Edition game system for Foundry Virtual Tabletop.

Foundry Virtual Tabletop 103 Jan 2, 2023
Simple shopping cart prototype which shows how React components and Redux can be used to build a friendly user experience with instant visual updates and scalable code in e-commerce applications.

This simple shopping cart prototype shows how React components and Redux can be used to build a friendly user experience with instant visual updates a

Ivan Kuznietsov 3 Feb 8, 2022