Wednesday, November 12, 2014

Unity Endless Runner Tutorial #5 - Pause

Original Tutorial
http://catlikecoding.com/unity/tutorials/runner/

My version of the game (Version Log)
http://www.hansadrian.com/Stuff/Endless%20Runner%20Tutorial/build.html

GitHub Gist (for full code files)
https://gist.github.com/HansNewbie/10005219/a6046d42e2b35dc67e411ff8ee22647992871e8f

Completed Project Files (V0.6.1)
Buy this on Selz Selz powering ecommerce websites

For version 0.5, I added pause system.

Wednesday, October 15, 2014

Procedural modeling: L-System Tree

Just sharing my L-system on tree creation. First time I did it in Dynamo (http://dynamobim.org/), around 6 months ago during my internship. This time around I am taking Computer Graphics module, so I did it in OpenGL for my lab assignment, although I only use tapered cylinder and ellipse-based cylinder as per assignment requirement.





Sunday, June 1, 2014

Android Home - Intent

Finally I figure out what makes an Android home/launcher an Android home/launcher. You need the intent to be so. The intent is android.intent.category.HOME. With that, your activity will be a home.

Thursday, May 22, 2014

Ceasing of Android Home Sample Development

GitHub
Home

Bad news. I am ceasing development on Android Home Sample. Reason being I found it very hard to update it to follow recent SDK since the basis of the code is very old. I could redo the whole thing, of course, but I find it would be better if I make one from scratch. I might be making a new repo for the launcher from scratch soon. We'll see :)

Thursday, May 1, 2014

Unity Endless Runner Tutorial #4 - High Scores

Original Tutorial
http://catlikecoding.com/unity/tutorials/runner/

My version of the game (Version Log)
http://www.hansadrian.com/Stuff/Endless%20Runner%20Tutorial/build.html

GitHub Gist (for full code files)
https://gist.github.com/HansNewbie/10005219/38e71e0c7358d15335412cbbbcdbb3facee36094

Completed Project Files (V0.6.1)
Buy this on Selz Selz powering ecommerce websites

For version 0.4, I added high score system. I was chasing for speed, so from software engineering view, I broke the architecture. I could not get past one problem.

Namecheap for GitHub Pages

So I was looking into custom domain for my GitHub Pages and I asked my friend which custom domain service he is using. He is using Namecheap1. I bought the domain and was configuring it when I was lost O_O because I am new to this and GitHub help does not have specific instructions on this. I googled and found http://davidensinger.com/2013/03/setting-the-dns-for-github-pages-on-namecheap/.

Hopefully it will work :)

Update:
Hoo Haa! It works :D Go visit my site! www.hansadrian.com

1. Affiliated links. If you wish to register without referral, go to namecheap.com :)

Wednesday, April 23, 2014

Sticking with Blogger

I think I am sticking with Blogger. I found syntax highlighting system for Blogger. You could find the post about it at http://mlawire.blogspot.sg/2009/07/blogger-syntax-highlighting.html. I will update the codes in this page with the syntax highlighter. I apologize for the upcoming layout changes every now and then because I want to update the blog design.

Thursday, April 10, 2014

Installing Jekyll On Windows. Ouch.

It is getting very painful to do code blogging here. No code marking, syntax highlighting and blah blah blah. I am thinking of using Jekyll to blog. And yeah, I thought I could straight jump into it but apparently not.

For those of you thinking of doing the same, here is my way. Note that I already installed Python in my computer.

1. Get Ruby and RubyGems - follow instructions from https://forwardhq.com/support/installing-ruby-windows
2. For syntax highlighting, install Pygments - follow instructions from http://zduck.com/2009/installing-python-pygments-on-windows/
3. Now, install jekyll - run gem install jekyll

That's all that I have done. Hope Jekyll would be great!

Tuesday, April 8, 2014

Unity Endless Runner Tutorial #3 - Boost Logo

Original Tutorial
http://catlikecoding.com/unity/tutorials/runner/

My version of the game (Version Log)
http://www.hansadrian.com/Stuff/Endless%20Runner%20Tutorial/build.html

GitHub Gist (for full code files)
https://gist.github.com/HansNewbie/10005219/38e71e0c7358d15335412cbbbcdbb3facee36094

Completed Project Files (V0.6.1)
Buy this on Selz Selz powering ecommerce websites

For version 0.3, I added a boost logo next to the logo counter to make the GUI more user-friendly. You could get the image I used as GUI texture below.

Sunday, April 6, 2014

Unity Endless Runner Tutorial #2 - Android Version

Original Tutorial
http://catlikecoding.com/unity/tutorials/runner/

My version of the game (Version Log)
http://www.hansadrian.com/Stuff/Endless%20Runner%20Tutorial/build.html

GitHub Gist (for full code files)
https://gist.github.com/HansNewbie/10005219/38e71e0c7358d15335412cbbbcdbb3facee36094

Completed Project Files (V0.6.1)
Buy this on Selz Selz powering ecommerce websites

For version 0.2, I added Android version - I updated the code with support for Android touch control. Check the Gist for the complete codes.

Saturday, April 5, 2014

Unity Endless Runner Tutorial #1 - Introduction

I am trying to learn Unity all over again. I found this interesting tutorial from Reddit on endless runner. Here is the link:


My version of the game could be found here:


Version Log:

I will try to improve the game bit by bit and share the code files via GitHub Gist. I will tag the posts with the same label as this (Unity Endless Runner Tutorial).

Also, to make the layout of my posts neater, I will use information box like below to pack the links together.


By the way, if you have not realized, I am using label/tag as topic of my post, so a series of post dealing on the same subject will have same label. Have a nice day :)

Wednesday, January 15, 2014

NUS ModCrasher: Behind the Scene #3 - Social Widget in CSS

See the Pen Social Widget Bar by HansNewbie (@HansNewbie) on CodePen.


So this is the social widget that I made for NUS ModCrasher. I put the relevant code in CodePen so you could look at it and use it if you want (Tell me if you are using it for your site!). The effects are in pure CSS, but I use JavaScript to open the link as a pop-up window - much like other websites. You can customize what you want to share in the href link as stated in the respective social sites' documentations (the links are correct - Facebook button shares Facebook website, Google+ button shares Google+ website, Twitter button links to posting Test this button - but they are not working; I assume CodePen blocks it).

NUS ModCrasher: Behind the Scene #2 - jQuery/Twitter Bootstrap Copycat on scrolling result



This is a long overdue post,but I will write it anyway. So I wanted to have the collapsible item in ModCrasher. Yos and I were using Bootstrap - thus jQuery - but I wanted a finer control of the scroll and I didn't use any other part of Bootstrap nor jQuery initially (Yos later used it to show the map on the result page). So I was thinking, "Why don't I try making it myself? Must be fun!!" So yeah, I made the collapsible result myself. I can't remember which code I looked at, but I think it was Bootstrap/jQuery code. I followed the idea, except being more general than that.

Sunday, January 12, 2014

Exact Age Calculator: Behind The Scene - Button With Pure CSS

So I was trying to make the button to calculate more apparent. I thought about it for a while and was reminded of what the button in NUS ModCrasher looks like. So I tried to make that using CSS only. Apparently, I could achieve similar result!

Here is the sample code snippet:

<!DOCTYPE html>
<html>
<head>
    <style>
    #button {
        cursor: pointer;
        text-align: center;
        width: 200px;
        padding: 5px;
        margin: 10px;
        margin-left: auto;
        margin-right: auto;
        border: 1px solid #999;
        border-radius: 10px;
        background: #FFD119;
        background: -webkit-gradient(linear, left top, left bottom, from(#FFD119), to(#E6B800));
        background: -moz-linear-gradient(top, #FFD119, #E6B800);
        font-weight: bold;
        height: 28px;
        box-shadow: 0 -8px inset;
    }

    #button:hover {
        background: -webkit-gradient(linear, left top, left bottom, from(#E6B800), to(#FFD119));
        background: -moz-linear-gradient(top, #E6B800, #FFD119);
        margin-top: 13px;
        height: 25px;
        box-shadow: 0 -5px inset;
    }

    #button:active {
        background: #403300;
        padding-top: 10px;
        height: 20px;
        box-shadow: 0 5px #000 inset;
    }
    </style>
</head>
<body>
    <div id="button">This is the button</div>
</body>
</html>

To see it in action, you could go to my Codebits at http://www.codecademy.com/HansNewbie/codebits/PmVTjH.

Exact Age Calculator

Exact Age Calculator
on Codebits by Codecademy

I don't know how I came up with the idea, but I was wondering it would be cool to know exactly how old are you. The calculations are pretty rough (I don't count by birthday, but by year as 365 days and month as 30 days) and it has not been up to hour and minutes, but it is kind of working.

I was thinking it would be cool if it could be improved to prompt which country you are from then pull the data of the country's life expectancy, then we do a countdown how long do you have to live and make your dreams come true.

I am quite satisfied with it, though, especially with the button since that was actually an 'accident'; I didn't plan for it, but I thought it was hard to differentiate between the button and the Age box and I just did it on the fly.

Many thanks to Build A Calculator! track on Codecademy for helping in making this Codebits!

Have fun!

Saturday, January 11, 2014

Android Home Sample

GitHub
Home

Hey guys. I have been trying to play around with Android homescreen, but the sample code is too old for the current Android version that it won't even display well. I will try to improve the sample code bit by bit while adding styles that I want as well. This will take a very long time since I am kind of busy. Hopefully I can make what I want to use and see. :D