How to simply replace text values with variables

overview

With the following method you only have to write the code for replacement once and can change the text in the Editor without digging into the source code again!

  1. Add a new text object:
    1
  2. Create and attach a new script to the text object, something like “ReplaceValueBehavior”:
    2
  3. In the Start() method of ReplaceValueBehavior.cs, set this code (and include UnityEngine.UI for Text):
     var myValue = "world";
     var txtObject = GetComponent<Text> ();
     txtObject.text = string.Format (txtObject.text, myValue);

    Like this:
    3

  4. Now set the text value of the text object to your output string and include a placeholder {0} for your variable:
    4
  5. When the scene starts, the placeholder will be replaced by your value:
    5

Done!🙂

 

MOK alpha 2 released

Hi folks,

the next alpha version of MOK is released. If you installed MOK before it should automatically update shortly. If you did not install it before, feel free to download it here:

https://play.google.com/apps/testing/com.FOURTYTWOBYTES.MOK

And as always, Feedback is very welcome, here is a short form to capture your thoughts about MOK: http://bit.ly/1NOAd2T

Aaand if you played MOK before, here is a list of all things that changed since last time:

– Improved ship controls (tap above ship possible)
– Added “Exit” button to start menu
– Added “Credits” button and page to start menu
– Added “Menu” button to world map
– Added sound to all buttons
– Added background music to each level
– Arrow to show direction to next dude
– Ship can break now even from level 1
– Ship starts to smoke before it breaks
– The mechanic will repair your ship – even faster with a wrench
– Removed SOOMLA package
– Added Unity Ads
– Added Unity Analytics
– Added Unity In-App Purchases
– Added Unity Crashreports
– Positioning all dudes correctly to the floor
– Improved 2D collider detection for all levels
– Adjusted maximum achievable scores for all level
– Ship crashed when time runs out

Happy MOKking everyone!

42 BYTES

 

MOK alpha released

Hi folks,

long time no see, right? Was a busy time lately but we finally were able to release a new alpha for MOK. Everyone is more than welcome to give MOK a try! All you need is an Android phone…

alpha-released

Get the alpha version on Google play:

get2bit2bon2bthe2bgoogle2bplay2bstore2bbutton

And please submit feedback here (we love feedback!):

MOK alpha feedback form

 

This alpha version (0.6) contains the first world, a total of 9 levels, 5 friends to pick up and a timer and friend counter. No music or decent sound yet and everything still a bit work in progress – don’t forget, it’s an alpha🙂

The first world is supposed to be easy (one should learn how to fly) but we challenge you to get 3 stars in each level… The next world (not included in this alpha) will be harder and you will be able to actually crash your ship – and more. Stay tuned!

 

Thanks everyone for testing MOK!

42BYTES

 

 

 

 

 

 

 

 

 

Official MOK logo

Hi folks,

just a quick update today, after spending a lot of time working on the game controls, finally had some time to draw a little bit more. Here comes the official MOK logo!

mok-cover

And it also looks like we’ll be able to release MOK for Android at the end of 2015, wohoo! Stay tuned.

42BYTES

First pre-alpha version of MOK playable online

Hi folks,

we have uploaded a very early pre-alpha version of MOK so you can play it in your browser. It does not have all the features planned and still feels a bit “clunky” but we think it can give you a good first impression on how it will look like in the final version.

It would be awesome if you could let us know your first impression after you played it. Even if you just played it for a few seconds or minutes, all input is very welcome!

MOK with his space ship
MOK with his space ship

Play MOK in your browser

(The Unity Web Player does not work on Chrome unfortunately)

Thanks guys!

42BYTES

MOK with his space ship

MOK – our beloved crash-test alien!

G’Day all!

Out of all the game ideas that 42BYTES (Y-Byte mainly) has, it is hard to pick which one to pursue first. We decided for DIGGER because we both love the concept and saw a lot of potential in trying out new programs. And of course we find, it’s great to play!🙂

Now as DIGGER is sort of our baby, obviously we don’t want to stuff it up. That’s why we decided to bring out a mini game first to test the waters.

And although this game started out purely as a crash test dummy, we came to love it!

It’s designed entirely in pencil and it’s about a cute little alien called MOK who is picking up his alien friends to attend a party.

MOK with his space ship
MOK with his space ship

The player is responsible to navigate the alien ship through different worlds (spiky field of thorns, moving bubbles etc) and tries to land beside his friends who excitedly jump up and down and then join him in his little ship.

The whole game design is in black and white pencil except for the “fire” coming out of the rocket jets and the ship can only be navigated upwards and to the sides.

The goal is to get to the alien friend as fast as possible. The less time it takes the player, the more points he gets in the end. Those points will be reduced if the landings were more than ungraceful or if the ship bumps into obstacles.

MOK is picking up a friend (early draft)
MOK is picking up a friend (early draft)

The navigation part is tricky because the rocket fuel keeps the ship moving; if you navigate to the right and release the button, the ship will continue to the right for some time depending on how long you pushed the button in the first place. Brakes are non-existent (much to the delight of X-Byte, the speed lover).

It was a nice change from the usual routine of spending the whole game dev process at the computer. Actually sitting down and doodling around is quite relaxing (especially for those nerdy eyes). We had way too much fun trying to come up with new characters – there will be lots more to meet in the final version of the game.

Three of MOK's extensive group of friends in need of a ride
Three of MOK’s extensive group of friends in need of a ride

We hope we will be able to release this “crash test dummy” soon. It’s our pioneer game to test the different app stores and their hurdles. You can only read so much about it, at some stage you just have to take the plunge and we got a bit defensive of DIGGER. To be honest, the same is starting to happen with MOK, we’re sure the game developers out there agree.😉

But that is what this is all about, and we know we will fall or stumble at some stage, as long as we get started and seek out new life and new civila… no, wait, that’s from somewhere else…

Have a great day guys,

42bytes-pencil

Free Programs To Use For Game Development

Hi folks,

there is a plethora of free programs you can use for your mobile app game development, and this list is far from complete (it’s not even a list really, only two programs). Access to game tools in general and free ones in particular has never been greater. It seems weird that we only use two such tools, when there is so many to choose from.

But that – I guess – comes with the fact that our first game DIGGER is designed to be simplistic and minimalistic…

UNITY

Unity is a tool specifically designed for game development – and oh boy it is good! It takes a bit to get into it but once the switch flips you’re in.🙂 As yBYTE (our coder) has a lot of experience in C# programming the development part is fairly easy for him.

This tool comes with a passionate and very helpful community. Don’t forget to follow them on Twitter or Facebook to keep up with all the upgrades. We also use Unity for the animation of our characters.

Animation controller screenshot for DIGGER.
Animation controller screenshot for DIGGER.

INKSCAPE

For our first game DIGGER we use Inkscape to design and create vector graphics. (Oh the secret is out, DIGGER is 2D!). We just started using Inkscape, and if you never have used similar programs before it can be a bit intimidating. But there are so many free tutorials out there and with a bit of practice everyone gets into it.

Screen Shot 2015-07-19 at 9.45.30 am
(These are some prototypes for our game DIGGER – a bone, an earth tile, a ruby, a cloud and a… a… one of those boom boom hammer thingys)

OTHERS

Other programs we might use for future games include Qubicle (a program to design 3D elements) and Harmony (software for drawing and animating characters). Those programs are not for free, and that’s why we decided against it for now. DIGGER is a leisure time project and not designed to make a lot of money. If it does however, we might buy these goodies in the future.

Have a great day everyone!

xBYTE

From programmer to game developer

Hi folks!

The second half of 42BYTES on the keyboard here – yBYTE. This is my very first blog post (ever!) and I want to tell you guys a bit about myself – let’s see if someone will read this at all.🙂

Schneider cpc464I am 34 (sounds pretty old) and have been interested in computers all my life. Wrote my first computer game when I was 12 (on a Schneider system if anyone knows what that is) in Basic if I remember that correctly. To edit a single line I had to type “EDIT: 10” and then work on that line and save it. Took me weeks to write a 10kb program… (it was a fishing game where one could select a spot at a lake and some bait and then wait… let’s say it wasn’t really that exiting.)

I chose and proceeded in a career in IT, focused nearly exclusively on  web based technology. Learned HTML, CSS, PHP, JavaScript and ASP.net C#. Especially C# is the most stable language to write enterprise applications (IMHO).

Every now and then I started building a game but never really pushed through and published it. Which is a bit sad as I think (as we all do) that I have great ideas – and could never give you all the opportunity to play  one of the incredible games I could make :D.

Now I teamed up with xBYTE and founded 42BYTES with her to change exactly that. She will be responsible for Marketing and Graphic Design while I am the Hacker and Game Designer – but she’ll tell you more about her part another day. The most important goal for us is to actually publish games – not just doodling around. So stay tuned for updates and follow us on our social media profiles.

At the moment we are busy setting up everything and getting used to all the tools we use, Unity and Inkscape for example, setting up Facebook, Twitter, Email Accounts, etc. etc. We are also working hard on the prototype for our first game which we will show you as soon as we can.

Thanks for reading and keep building awesome games folks!

-yBYTE