Ludum Dare 31

The theme is “Entire Game on One Screen”, which is great, because all my games have been in one screen. So basically, I can make anything! (And I don’t even have to worry about Menus and Title Scenes)

But I’m still stuck-ish with an idea. I mean, there were a lot of ideas going through my head, but I just keep on browsing and looking at other people’s WIPs and I just get intimidated, and shoot down everything.

I ended up not doing anything on Saturday, and only started Sunday morning.

I attempted to use Blender to create some low poly trees, snowball and terrain. But all I manage to create are primitive shapes! ūüėÄ

Screen Shot 2014-12-07 at 11.20.55 AM

Screen Shot 2014-12-07 at 11.24.14 AM

And then I assembled the trees in Unity! AHAHA

Screen Shot 2014-12-07 at 1.04.01 PM

I started using Unity terrain but realized it’s not low poly enough for the look that I’m going for.

So I went back to Blender, looked up a tutorial and came up with this:

Screen Shot 2014-12-07 at 3.38.55 PM

And then I started planting trees…

Screen Shot 2014-12-07 at 6.24.31 PM

Screen Shot 2014-12-07 at 6.25.28 PM

And then I recorded some pretty annoying Christmas song (no lyrics, because it’s lyrics is copyrighted, but not the tune) and edited it in Audacity.

And at the end of the day (actually I took a very long break, and was sleepy, so instead of compo, I finished it as a jam), I have this:

Screen Shot 2014-12-08 at 9.22.45 PM

Knock ‘Em Trees

You play as a snowball, trying to Knock ‚ÄėEm down some Trees. And you get bigger as you knock down more trees, allowing you to knock down some even bigger trees.

thumbnail

Ludum Dare page: http://ludumdare.com/compo/ludum-dare-31/?action=preview&uid=18262

Game Jolt page: http://gamejolt.com/games/arcade/knock-em-trees/41188/

I didn’t qualify for compo, but might as well share my code, GitHub:¬†https://github.com/purplelilgirl/LudumDare31

Check it out? It’s my first Ludum Dare, so please be kind ūüôā

Based on the comments I received on the game so far, is that people seem to like the trippy background music, so I uploaded the video of how I made the background music (hear me sing ahaha),

How to open a website in Unity without popping out of your App? (iOS)

I know you can always use Application.OpenURL, but if you use that, you will pop out of your app and open Safari, and then the user would have to press the Home button, and then navigate back to your app…

As a game developer, my goal is to keep my players within the game as much as possible.

Although there are times that you might want to show a website to your players (your company’s website or Facebook page, perhaps?)

So I imitated Apple’s SKProductViewController, create a UIWebViewController and present it as a modal view.

It will look like this:

IMG_7697

(to prevent the Status Bar showing in the Appstore view, add View Controller based Status Bar to Info.plist and set it to false)

Some Code Bits: NativeWebView.h and NativeWebView.mm

#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>

// Root view controller of Unity screen
extern UIViewController *UnityGetGLViewController();

@interface NativeWebView : UINavigationController
{   UIWebView *webView;
}

-(void) openURL: (const char*) urlString;
-(void) dismissModal;

@end

#import “NativeWebView.h”

@implementation NativeWebView

– (id)init
{
    webView = [[UIWebView alloc] init];
    
    UIViewController *webViewController = [[UIViewController alloc] init];
    webViewController.view = webView;
    
    self = [super initWithRootViewController: webViewController];
    
    self.navigationBar.barStyle = UIBarStyleDefault;
    
¬†¬†¬† UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@”Cancel” style: UIBarButtonItemStylePlain target:self action: @selector(dismissModal)];
    [self.navigationBar.topItem setLeftBarButtonItem: cancelButton];
    
    return self;
}

-(void) openURL: (const char*) urlString
{
    NSURL *url = [[NSURL alloc] initWithString: [NSString stringWithUTF8String: urlString]];
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
    [webView loadRequest:request];
        
    [UnityGetGLViewController() presentModalViewController: self animated: YES];
}

-(void) dismissModal
{   [UnityGetGLViewController() dismissModalViewControllerAnimated: YES];
}

-(BOOL) shouldAutorotate
{   return false;
}

@end

static NativeWebView *nativeWebViewPlugin = nil;

extern “C”
{
    void _OpenURL(const char* url)
    {
        if (nativeWebViewPlugin == nil)
            nativeWebViewPlugin = [[NativeWebView alloc] init];
        
        [nativeWebViewPlugin openURL: url];
    }
}

And then on Unity side, I have a WebViewHandler.cs:

using UnityEngine;
using System;
using System.Collections;
using System.Runtime.InteropServices;

public class WebViewHandler : Singleton<WebViewHandler> 
{
    #if UNITY_IPHONE
    [DllImport (__Internal)] private static extern void _OpenURL(string url);
    #endif
    
    public void openURL(string url)
    {
        if(!Application.isEditor)
        {    #if UNITY_IPHONE
            _OpenURL(url);
            #endif
        }    else
        {    Debug.Log(WebViewHandler:: Cannot open WebView in Editor.);
        }
    }
}    

So… to open a website from Unity just call WebViewHandler (which is a Singleton) and pass the URL:

WebViewHandler.Instance.openURL(m_url);

That’s it! ūüôā

All codes and UnityPackage are available in GitHub: https://github.com/purplelilgirl/Unity-NativeWebView

 

 

Taipei Game Developers Forum 2014

Orangenose Studio took part in this year’s Taipei Game Developers Forum.

_MG_8606

_MG_8611_MG_8616

Our founder and CEO, Leon Chien, gave a talk to share our mobile game development experience, and identify key factors for global success.

IMG_8619IMG_8629

By the way, we are still hiring game artists and programmers.The way we work is quiet different, we work in ninja teams of two (1 artist and 1 programmer), who are involved in the entire process of their game, from conceptualization to execution.

Check out our 104 for more info: http://www.104.com.tw/jobbank/custjob/index.php?r=cust&j=3b63456f596f4c243b453d242f31396203b3d456e3739416a3f453d20202020631494d5b3452j98&jobsource=n104bank1

 

Swatchmate Cube Unboxing

My roommate funded the Swatchmate Cube on Kickstarter, and her Cube just arrived yesterday!

This cube can capture the color of any flat surface! It has a companion app for both iOS and Android and you can send the RGB values of the capture colors to your email.

We tried to capture the color of everything… My iPhone case, Macbook sleeve, scarf and even our skin… It’s awesome!

Kickstarter Link: https://www.kickstarter.com/projects/657220568/swatchmate-color-capturing-cube

 

How to open Appstore in Unity? (iOS and Android)

How to open Appstore in Unity for iOS and Android? And how to not leave app when doing it?

You can just download my NativeAppstore.unitypackage, and import it into your project. (I haven’t wrote about the nitty gritty of creating Unity plugins yet, so this post will not go into the iOS or Android codes)

You can take a look at AppstoreTestScene.cs:

using UnityEngine;
using System.Collections;

public class AppstoreTestScene : MonoBehaviour 
{
    public string m_appID_IOS = 840066184;
    public string m_appID_Android = com.orangenose.noone;

    public void OnButtonClick(string buttonName)
    {    
        if(buttonName == ViewApp)
        {    
            if(!Application.isEditor)
            {
                #if UNITY_IPHONE
                AppstoreHandler.Instance.openAppInStore(m_appID_IOS);
                #endif

                #if UNITY_ANDROID
                AppstoreHandler.Instance.openAppInStore(m_appID_Android);
                #endif
            } else
            {    Debug.Log(AppstoreTestScene:: Cannot view app in Editor.);
            }
        }
    }
}

Pass your iOS and Android ID to AppstoreHandler (which is a Singleton), and it will be in charge of opening your Appstore for you.

For iOS, I use SKStoreProductViewController when its available, and if it’s not it defaults back to OpenURL (that unfortunately will pop you out of your app).

For Android, I use Uri Intent.

They are modal views, which means that it will not pop you out of your app. For iOS, just click Cancel, while for Android, just click Back Button to go back to your Unity scene.

IMG_7666 Screenshot_2014-12-02-22-10-30

When can you use this? For example, you want your players to rate your app, or you want to cross sell another of your apps.

All the codes are available on Github: https://github.com/purplelilgirl/Unity-NativeAppstore

By the way, the Apps shown in the tutorial is Toughest Game Ever 2, which is available for iOS and Android, and I’m part of the team that made the game. So please check it out, download, show us some love?