Git Product home page Git Product logo

arblocks's Introduction

ARBlocks

Hey there, I've created this prototype that serves as an experimental game. The game is an iOS AR experience for building with cubes (similiar to Minecraft). The game detects horizontal surfaces so you can place blocks on top of them, from there you can place blocks adjacent to one another or more on top of the detected plane. You can place blocks with different colors and remove unwanted blocks besides being able to save your creations for later retrieval.

How to play

First, you'll need a flat horizontal surface, could be your table or the floor depending on how reflective it is. The more opaque, bigger and flatter the better. Then, point your camera to the surface and soon the app will detect it and place a semi-transparent white plane on top of it. Now you're good to go:

Print

  • You can pick 1 of 5 colors to place a cube of that color wherever on top of the plane or adjacent to another cube.
  • To remove a block you select the trash tool and tap an existing block to remove it.
  • To select a cube (or multiple) choose the select tool (the icon is a scope for lack of a better SF Symbol) and tap existing blocks, they will become semi-transparent, indicating that they are selected, to deselect, simply tap is again.
  • To use the selected blocks as a blueprint for a new construction, use the hammer tool, now instead of placing a single block, you will place all the blocks you selected (using the first you selected as a starting point).
  • To save the selected blocks, tap the save button to the side of the hammer, give a name to your construction and save them.
  • To load a saved construction, simply tap the folder icon on the top left and choose the construction you want to load, the use the hammer tool to spawn as many of those as you'd like.

How it works

The HUD views and app presentation are all handled by SwiftUI, the AR logic and presentation is made using ARKit and SceneKit. Now, diving deeper into the architecture, I know it is not very scalable at its current state, but I made this app to be small and had limited time to study, plan, develop and test it.

I improvised 4 layers:

  • View and Publisher layer (views show the app's user interface, the publisher manages the communication between AR layer and View layer)
  • AR layer (objects responsible for the AR, plane detection and block and construction placing logic)
  • Database layer (self explanatory)
  • Model and Repository layer (the 2 together act as an interface for the publisher and view layers to access the database layer)

That's about it, to get a more detail oriented perspective on how I've developed all this, I've used docC comments to document almost all of my code.

arblocks's People

Contributors

dantoso avatar

Stargazers

 avatar Igor Silva avatar

Watchers

 avatar

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.