Giter Site home page Giter Site logo

aquago's Introduction

aquago

A Digital Aquarium written in go - A toy project

Which is something like this (depending on your fishes and decorative elements!):

aquago

Aquarium Content

Our digital aquarium is consisted of four separate entities:

  • The background - a static image which is the seabed
  • The bubbles - some decorative bubbles as real aquariums have
  • The BG items - decorative items which can be dragged and placed round the seabed
  • The FG items - the "alive" organisms of the digital aquarium which "freely" move around

In order to run this application read the following steps.

Prerequisites

  • a supported Go version with modules enabled
  • a Google Drive's account
  • an installed C compiler (for ebiten)

Clone this repo

Clone this repo by running

git clone https://github.com/mzampetakis/aquago.git

Configuration

Env Vars ๐Ÿ“„

Before running the app all configuration must be set. The configuration can be added an OS's Env Vars or inside the provided .env file. The necessary variables are:

# GDrive Folders
# Folder ID to retrieve BG items
BGFOLDERID=1EDCChSY0ujjrpL-fK0S4R89zpWxLYcHS
# Folder ID to retrieve FG items
FGFOLDERID=1065nob35R6cIgB_aUIcW4fOwMV6D9oiS

#Saved Assets
# Image to use as background
BGIMAGE=assets/bg4.png
# Folder to save downloaded BG items
GDRIVEBGSFOLDER=assets/gdrive/bg/
# Folder to save downloaded FG items
GDRIVEFGSFOLDER=assets/gdrive/fg/
# Folder to save processed BG items
BGSFOLDER=assets/bg/
# Folder to save processed FG items
FGSFOLDER=assets/fg/
# Wether to remove saved assets - used to retrieve only the latest active assets
CLEARASSETS=true

#Google Drive Credentials file
GDRIVE_CREDS_FILE=credentials.json

Google Drive oAuth ๐Ÿ—‚

In order to setup the Google's Drive API oAuth please read the documentation provided in the corresponding repo.

Running the app ๐Ÿƒโ€โ™‚๏ธ

When configuration is ready you can run the app by executing:

go run main.go

After proceeding with the Google's Drive oAuth steps as presented here the application will start to download and transform the assets. While donwloading you will see an empty aquarium and your assets will gradually pop in.

Results ๐Ÿ 

If no items are found within your Google Drive (or while they are getting downloaded) you will see something like this:

Empty Aquarium

If you have added assets in your Google Drive you will see something like this after all of them have downloaded (depending on your assets):

Full Aquarium

Gifts ๐ŸŽ

All images used in this project have their background removed!! This was not done by hand of course. Each image used in this app (either as BG or FG) after being retrieved from Google Drive is transformed! This transformation removes image's background (if possible - using a sample from the top left portion of the image and a threshold), crop's it to leave only the effective image and resizes to a valid size.

This transformation is presented in the following image:

Image Transformation

Also, at runtime, application polls the Google's Drive folders for newly added images and if a new image is found, it is downloaded, transformed and then it just pops into the aquarium! That's quite convenient!

Future Work ๐Ÿก

  • Run without the need of Google Drive usage. Work with local images placed in the corresponding folders.
  • Improve the background removal algorithm (needs better efficiency with decent performance)
  • Add some background sound - as a real aquarium.

Enjoy

I hope you enjoy this app at least as I did while developing and using it...

Contributions are more than welcome in form of PRs or issues! But most importantly I would like to know if you enjoyed this!

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.