Category: Programming

24 hours of code – Hosted by Accenture

I have participated in a Hackathon, hosted by Accenture. The proposed project was very interesting: a social app for blind people. The technical requirements for the app were pretty obvious for this scenario. The app had to have an interface friendly towards people with total or partial blindness. I was very happy to work on this project, as I though about these kind of challenges for a visually impaired person before, but never had an opportunity to challenge myself on this before. I am pretty happy with my result. The app can be cloned from the repository here, and the Continue reading

Publishing Unity game to App Store & fixing errors in Xcode

This is a quick tutorial on how to export your Unity project to Xcode and then from Xcode to the App Store without errors, fixing these errors and warnings: – Module ‘GoogleMobileAds’ not found;– Missing Marketing Icon;– Push notifications not enabled;– Undefined symbols for architecture armv7.

Synchronizing player currency (not score) over multiple devices – using a cloud

I was building a racing game which uses a fake currency. The player receives money when winning races, money that he can use to buy new cars or unlock new tracks. But what if the player was playing during the day on his phone, and at night on a tablet? I wanted the progress to be synchronized.   The solution is simple when synchronising a game that has a score that only goes up (incremented in only one direction). if (scoreInCloud > scoreInDevice) { //download          scoreInDevice = scoreInCloud; }else{ //upload               Continue reading

Arduino fishtank light control

Here is how the final product looks like:   The required parts are: – an Arduino Uno board; – a LCD shield; – a relay; – two brick buttons; – cables. The case is optional, but here is the 3D model if you want to 3D print it: http://www.thingiverse.com/thing:2008460 We will connect our fishtank’s lamp to a relay, that we will turn on and off at certain times a day. In my case, I turn the light on at 9am and turn it off at 10pm. Here is the code:   // include the library code: #include <LiquidCrystal.h> // initialize Continue reading

CSS3 On / Off switch

Here is a simple CSS3 On / Off switch. You can use JavaScript code to find the current switch state. This example only provides the styling part of the element. This is a lightweight solution for building from scratch a toggle button (switch). It can work on any platform that supports CSS3. The HTML: <div class=”switch” id=”switch”> <a href=”#thinghyL”> <div class=”thinghyL” id=”thinghyL”><div class=”knobL”></div></div> </a> <a href=”#thinghyR”> <div class=”thinghyR” id=”thinghyR”></div> </a> </div> The CSS: .switch { width:100px; height:30px; background-color:#eeeeee; border-radius:15px; border:solid thin #000000; float:left; overflow:hidden; } .thinghyL { height:100%; width:100%; background-color:green; border-radius:15px; transition: width 300ms ease-out; float:left; margin-left:0px; position:relative; z-index:10; } Continue reading

CSS3 Login Form Styling

Inspired by the concept design of the folks over at invisionapp.com I decided to animate a login form using CSS3. It looks great for mobile devices apps or just websites. It is a CSS3 Login form – animated! with step by step instructions. You can look at the code over at jsfiddle.net, and you can use it however you like, as long as it is for non-commercial purposes. That’s it! I hope you find this useful. HTML code: <div class=”loginBox”> <form name=”form1″ action=”do_login.php” method=”post”> <img src=”http://www.niandrei.com/tutorial/css3/ep1/logo.png” style=”width:200px; height:200px” /><br><br><br> <div class=”usernameMask”>&nbsp;</div> <input type=”text” size=”30″ tabindex=”1″ id=”fa”><br> <div class=”passwordMask”>&nbsp;</div> <input type=”password” size=”30″ tabindex=”2″ id=”fb”><br> <div Continue reading

Building a mobile game for kids

So I decided to enter the mobile game market (a little late, I know), by creating a mobile game for iPhones primarily, and then port it to Android devices and Windows phones. The game will be targeted to children. I choose ImpactJS as the main platform, because it uses the canvas HTML5 element to do the rendering. The Canvas element is supported by many platforms already, so it’s fairly easy to port it to multiple devices. I have made a couple of games with ImpactJS so far, so I have some experience with it, though I’m still learning many of Continue reading

Javascript Artificial Intelligence Tutorial – For beginners

Here is a simple JavaScript Artificial Intelligence Tutorial for beginners using the reinforced learning method. You need to have basic knowledge on HTML, CSS and JavaScript, as well as programming basics. This tutorial is a starting point for people who want to implement A.I. in their projects. You are free to “steal” ideas and techniques from this 🙂 In this tutorial we will create a car with an A.I. driver, which will drive along a road avoiding obstacles. The avoiding will be made by the A.I. and not by direct programming (like using IF-statements). There are multiple ways to achieve Continue reading