Unity 3D Game Development by Example Beginner’s Guide: Game #2

Uncategorized

A few months ago, I wrote a blog post on #AltDevBlogADay reviewing a Unity3D book written by Ryan Henson Creighton, Unity 3D Game Development by Example Beginner’s Guide (buy the book, it’s pretty good, so far), but I only gotten around to Chapter 4.

Unity 3D Game Development by Example Beginner's Guide

So for this blog post, I will go through some of the other chapters, particularly Chapter 5 and 6, which is about making a game called “Robot Repair”.

Chapter 5 will talk about GUI (graphical user interface, pronounced as “gooey”, like marshmallows). And we’ll be making an entire working 2D flip n’ match memory game in the GUI system.

So let’s get started!

First we open Unity and create a new project called “Robot Repair”, we don’t need to import Standard Assets, according to the boss (Mr. Author, Ryan Henson Creighton).

So we have an empty slate (este project).

A Unity scene is a big 3D world, but we would be ignoring that for now. We will be using the GUI layer, which is like “a sheet of glass” in front of our 3D world.

We will be making 2 scenes for this game. A scene is like a level or a screen in our game. So two scenes, one for the title and one for the game game.

(how organized are we)

So we are making the title screen first.

(tada!)

Of course, so far the TitleGUI script is still empty.

And we type some code (este copy paste from the book):

And we get this:

And if you clicked the button, you get a lil message:

(yeah)

The book came with some code files and assets for each chapter, packed as Unity packages, just double click on the file and it’ll import it to your project.

For the title screen, the author has prepared a cute image that we will add as a GUITexture, and so we get this:

(oh, we also changed the position of the button, so it’s front and well, not really center)

And then hook the button to some code that will bring us to the game:

Application.LoadLevel(“game”);

(yes, this short little code will bring us to the next scene, if we have our scenes added to our build settings)

Lalala… okay, time to make the actual game game.

We go to the game scene (just double click on the scene in the Project panel).

And we’ll make a GameScreen game object and a GameScript script (like what we did with the title screen).

Ooh… what codes will we fill this new script with? *copy paste some codes from the book* Okay, and read up on the explanations too.

And we get this!

(whee)

And then we are done with one chapter. Look at us, pretty good, huh.

Advertisements

Review: iPhone JavaScript Cookbook

Uncategorized

iPhone JavaScript Cookbook

https://www.packtpub.com/sites/default/files/imagecache/productview/1086EXP_iPhone%20JavaScript%20Development%20Cookbook_cov.jpg

This book is written by Arturo Fernandez Montoro.

This book is written for web dev guys, I guess, who wants to write native looking web applications for the iPhone. The book introduces a lot of frameworks to make life easier. the frameworks include native looking assets for user interface building, which you can call with just a line of code. This book also teaches the readers how to work with data using from SQL and AJAX.

Since this is a cookbook, it includes a lot of recipes that readers can copy and paste and revise.

If you want to make applications for the iPhone that look like applications for the iPhone, without having to learn Objective C, the iPhone SDK and all, then this book is a great guide for you. 🙂  

Link: http://www.packtpub.com/iphone-javascript-cookbook/book/mid/170811hge054

New iOS and Android Books from Packt

Uncategorized

iPhone JavaScript Cookbook

iPhone JavaScript Cookbook

Written by Arturo Fernandez Montoro

Overview of iPhone JavaScript Cookbook

  • Build web applications for iPhone with a native look feel using only JavaScript, CSS, and XHTML
  • Develop applications faster using frameworks
  • Integrate videos, sound, and images into your iPhone applications
  • Work with data using SQL and AJAX
  • Write code to integrate your own applications with famous websites such as Facebook, Twitter, and Flickr
  • These practical recipes include code and screenshots offering a clear step-by-step guide using different frameworks

Link: http://www.packtpub.com/iphone-javascript-cookbook/book/mid/170811hge054

Cocoa and Objective-C Cookbook

Cocoa and Objective-C Cookbook

Written by Jeff Hawkins

Overview of Cocoa and Objective-C Cookbook

  • Develop Cocoa applications using advanced UI concepts
  • Implement the latest Objective-C features and incorporate them into your applications
  • Debug Cocoa applications using advanced tools and techniques
  • Add advanced animation and multimedia to your Cocoa applications

Link: http://www.packtpub.com/cocoa-and-objective-c-cookbook/book/mid/170811c2v5x9

Core Data iOS Essentials

Core Data iOS Essentials

Written by B.M.Harwani

Overview of Core Data iOS Essentials

  • Covers the essential skills you need for working with Core Data in your applications.
  • Particularly focused on developing fast, light weight data-driven iOS applications.
  • Builds a complete example application. Every technique is shown in context.
  • Completely practical with clear, step-by-step instructions.

Link: http://www.packtpub.com/core-data-ios-essentials/book/mid/170811chs5cu

Flash Development for Android Cookbook

Flash Development for Android Cookbook

Written by Joseph Labrecque

Overview of Flash Development for Android Cookbook

  • The quickest way to solve your problems with building Flash applications for Android
  • Contains a variety of recipes to demonstrate mobile Android concepts and provide a solid foundation for your ideas to grow
  • Learn from a practical set of examples how to take advantage of multitouch, geolocation, the accelerometer, and more
  • Optimize and configure your application for worldwide distribution through the Android Market

Link: http://www.packtpub.com/flash-development-for-android-cookbook/book/mid/170811i8nwzh

Android Application Testing Guide

Android Application Testing Guide

Written by Diego Torres Milano

Overview of Android Application Testing Guide

  • The first and only book that focuses on testing Android applications
  • Step-by-step approach clearly explaining the most efficient testing methodologies
  • Real world examples with practical test cases that you can reuse

Link: http://www.packtpub.com/android-application-testing-guide/book/mid/170811fja1lj

Anyone interested in obtaining a free review copy in order to review the book in preferably under 2 weeks time can contact Packt’s online marketing representative Shaveer at shaveeri@packtpub.com with the subject line “book name- review request”. It can be for more than 1 book as well.

iPhone and iOS books Giveway!

Uncategorized

So Packt Publishing recently released a couple of iPhone and iOS books:

iPhone JavaScript Cookbook

iPhone JavaScript Cookbook

Link: http://www.packtpub.com/iphone-javascript-cookbook/book

Core Data iOS Essentials
 

Core Data iOS Essentials

Link: http://www.packtpub.com/core-data-ios-essentials/book

Cocoa and Objective-C Cookbook

https://www.packtpub.com/sites/default/files/imagecache/productview/0386OT_Cocoa%20and%20OBjective-C%20Cookbookcov.jpg

Link: http://www.packtpub.com/cocoa-and-objective-c-cookbook/book

And the wonderful people that had been giving me free books, asked me to hold a giveaway contest, so that well, you guys can get them too.

How to join? All you have to do is visit the 3 book pages and mention one feature about a particular book that makes you want to own it.

You can leave a reply here on Tumblr (using reply or Disqus comments) or tweet me (@purplelilgirl).

So um yeah, that’s it. I will be giving away one of each book. 🙂

Packt Celebrates its 50th Oracle Book

Uncategorized

Throughout July Packt Publishing will be celebrating the release of its 50th Oracle book – cementing its reputation as one of the leading publishers in Oracle books.

To mark this milestone Packt is offering the following discounts:

·         20% off all Oracle print books

·         30% off all Oracle eBooks

Packt first started publishing Oracle books in 2006, and has since published best-sellers such as Getting Started With Oracle SOA Suite 11g R1 – A Hands-On Tutorial, Oracle Coherence 3.5 and Oracle Fusion Middleware Patterns.  And with more than 20 exciting new Oracle titles scheduled for 2011 this current success is only set to increase.

Packt owes much of its success to its print-on-demand mantra which not only allows it to produce books on specialist areas, but enables a quick response to new developments in technology – which was recently demonstrated with Packt publishing the first ever book on GoldenGate, the Oracle GoldenGate 11g Implementer’s guide.

Packt’s entire range of Oracle books is also available via PacktLib, Packt’s Online Library, and as part of Packt’s celebrations it’s offering you the chance to win a year’s subscription to PacktLib worth $220 click here for details: http://www.packtpub.com/article/50th-oracle-book-offer

For further information on this, and other books published by Packt Publishing, please visit www.PacktPub.com

Packt Open Source announce exclusive discount offers on best-selling books

Uncategorized

Packt Open Source has this week announced a series of discounts on its selection of best selling Open Source books. Readers will be offered exclusive discounts off the cover price of selected print books and eBooks for a limited period only. 

So far in 2011, Packt Open Source announced in March that its donations to Open Source projects has surpassed the $300,000 mark, while in April insight into various projects was offered during the ‘Believe in Open Source’ campaign and July’s series of discounts continue this trend of Packt showing its commitment to the Open Source community.

The Packt Open Source books included in this exclusive discount offer include well known books such as JBoss AS 5 Performance Tuning, PHP jQuery Cookbook, Drupal 7 Module Development and Blender Lighting and Rendering, amongst others.

“This special discount showcases a host of Packt Open Source topics and allows readers to purchase some of our most well renowned books at an exclusive price” said Packt Open Source Marketing Executive Julian Copes. “

To ensure you do not miss this fantastic offer, visit the special discount page now, where you can view the extensive list of books included in the offer and access an array of related articles that were written by the authors.

The exclusive discounts are available from 4th July 2011. To find out more, please visit the Packt website.

Review: Unity 3D Game Development by Example Beginner’s Guide

Uncategorized

Unity 3D Game Development by Example Beginner's Guide

This is an excerpt of my previous blog post.

This book is written by Ryan Henson Creighton aka Cassie the 5 yr old game developer’s dad. This book is about 380 something pages, and it takes you through Unity from the basics (as in what Unity is, what you can and cannot do *hint* MMOs unless you are really popular and has like a hundred friends or something). And then he teaches through examples, hence the title of the book. He also gives readers programming basics. All in all, the author is actually quite a fun read, because of his wit and humor, and it is nothing like my Computer Programming 1 professor, who tends to drone.

Overall, I think this book is easy read, it’s not intimidating in such a way that it bombards you with information, code bits that you can’t even begin to grasp. I think that beginners, even those who have “never coded before” would find this book easy to digest, and might even be able to “build fun games”.

For those who are interested in the book, you can check it here. The book actual offers samples codes and projects that you can download even if you haven’t bought the book, here.

Build fun games even if you’ve never coded before

Uncategorized

Reblog of my AltDevBlogADay post.

“Start developing games straight away. Build your first game in the first chapter.” “Fun and fast paced. Ideal for readers with no game programming experience.” “A cool guide to get into the game industry quickly.”

Doesn’t that sound like an advertisement for weight loss, except for well, making games. Those are the lines on the “back cover” (if eBooks have back covers) of game development beginner’s guides. But can you really make a game after reading the book? That’s what I want to find out.

So I grab a copy of Unity 3D Game Development by Example Beginner’s Guide (written by Ryan Henson Creighton aka Cassie the 5 yr old game developer’s dad) and I will write this blog post as I read through the book and make that game. There also Beginner’s Guide books for Cocos2d (Cocos2d for iPhone 0.99 Beginner’s Guide written by Pablo Ruiz), XNA (XNA 4.0 Game Development by Example: Beginner’s Guide written by Kurt Jaegers) and Flash (Flash Game Development by Example written by Emanuele Feronato).

Some disclaimer, I am not a complete beginner at Unity. I spent maybe a year (two years ago) making technical demos using Unity, for a game art outsourcing company in the Philippines that wants to break out from outsourcing to creating their own games. But I left that company, and country and well, to come to a tiny studio in Taiwan to make iPhone games. So here I am, reacquainting myself with Unity. Hi Unity, I’m Hsiao Wei Chen, nice to meet you (okay, that was lame).

So here we go, first chapter. Chapter 1: That’s One Fancy Hammer. (You can read the first chapter on the PacktPub website) Basically, a little intro about Unity. I don’t think I need to tell you guys what Unity is. And he starts telling us about what type of games you can build with Unity, and he shows us Fusion Fall (an MMORPG game by Cartoon Network)…  “You can make an MMORPG with Unity? That is awesome! I wanna make my own MMO!” screams the excited reader. And then he slams that thought by telling the readers to check the credits. You need to clone yourself 79 times, according to the author, and send yourself to school to study various disciplines.

Okay, so no MMO, so what game are we gonna make, Mr. Author sir? Then he points us to games on Blurst and Wooglie. Casual games? I don’t know about you, but I love casual games, I mean that how I got into this business in the first place (read about how I stumbled into this whole game making business on Gamasutra, in case you’re interested, but you’re probably not, anyway, moving on). Okay, casual games it is then, because we need to “Walk before you can run (or double jump)”. And then it’s hammer time, head on over to the Unity website and download well, Unity, and then install install, and then launch!

And then he starts explaining the interface. I took down some notes:

(my “notes”, forgive my terrible handwriting)

And then we move on to the next chapter! Chapter 2: Let’s Start with the Sky. Are we going to be making skies? Read on, the author asks us, “It’s time to build a game, right? But how do you start? Where do you start?” Um, I don’t know, you tell me. He tells us, that every game starts with an idea. But the number of ideas you come up with doesn’t matter. “The one thing that separates you from success is not the number of ideas you’ve had or the number of projects you’ve started and abandoned, it’s the games you’ve finished that count.” Is that directed at me? I have a tendency to have a lot of ideas, starting a lot of projects, but never finishing them. That line really struck me, sir. Yes, sir, I will try to finish my games, okay not try, I WILL finish my games.

And then he talks about “The Siren Song of 3D” (how beautifully put). He says that before we even begin, the odds are already stacked against us! That’s a mean thing to say. He points out that games like GTA, Mario or Fall Out 3 is they have “an animated character or first-person camera moving around in a physics-based environment; a rich and detailed 3D world with maps… teams of hundreds of people burning through multimillion dollar budgets…” Okay, we get it, we can’t make MMOs and AAA quality games.

And then he starts talking about features vs content, and giving a lot of examples of games along the way. The summary: “By cutting features from your game ideas, you can whittle your design down to a more manageable size than by cutting content”. Okay, got it. Can we get started now? I want to make some games! (or at least one game, before the night is over).

Chapter 3: Game #1 Ticker Taker. Yeah, finally! So what game are we going to make? Volleyball. He wants us to make a volleyball game, I hate volleyball (or rather, I suck at vollyeball). But he did ask nicely for us to pretend that we are totally pumped about volleyball. Fyeahvollyeball!

*takes a break to do the laundry*

Okay, now where were we? Oh yeah, game, and volleyball. I love volleyball. Read, read, read. The author Is explaining the rules and the complexities of volleyball and he came to conclude: “You + volleyball game = badIdea.” I know right, really bad idea. But then he insists that volleyball is my dream, my passion, that is why we must strip volleyball down to it’s bear essentials and start from there. Okay, he instructs me to get “a red pen and/or machete”, gotcha. Okay, I have my machete, who do we kill? -Sets, teams, multiple players, net, referee, spectators, and then the player. Wait, what? We’re even killing the player? What’s left? A ball. A ball floating in midair. A ball that cannot touch the floor. And something to bounce the ball on. Okay, I can work with a ball (in fact, I think I can even make a 3D model of a ball in Blender).

So let’s go to Unity. Create new project and then add a new object to the scene, a sphere, which will serve as our ball. So we name him, Ball!

(more “notes”, before and after)

He says that our ball right now is between the ground (half above ground, half below ground). And we must move the ball up to the sky. We change the Y position of the ball to 2 (in the Inspector panel). Okay, that was easy. Next, he complains that our ball is too big, so we scale it to 0.4 for X, Y and Z. Okay. Next step? Save the scene.

Now, we have our ball, next is our paddle (the thing that we are going to have our ball bounce on). We create a cube (Game Object > Create Other > Cube), and we name him Paddle, and then we scale him, so he’ll look less like a cube and more like a paddle. Alright then.

And then we add a light to our scene.

(our ball and paddle used to be dark an dreary, now it is all lighted up. like a make up commercial)

And then we test our game! We hit Play. *those black crows from Japanese animes fly by* Nothing happens.

The author is pulling our leg, he wants us “to test your game at this point, even though nothing happened, to pinpoint that magic moment when Unity becomes awesome.” Okay, well, I can’t wait for things to become awesome.

Add physics to our game! Click on Ball in the Hierarchy panel, and then go to Component > Physics > Rigidbody, to add a Rigidbody to our Ball. And make sure that Gravity is checked in the Inspector panel. And we could hit play again (at least he is telling us to hit play again). Our ball fell down and hit the paddle! Whee! It was “especially cool” (he says I can get ten points, if I said that that was especially cool).

Next, we want our ball to bounce. Because, in real life, ball bounce, right? At least volleyballs bounce (I know that much about volleyballs). So we set the Material property of the Sphere Collider of our ball to Bouncy. And press play again, and it is magically bouncy! “Especially cool”! And that’s the end of chapter 3.

But the ball just keeps bouncing and we can’t do anything. So we have to move on to the next chapter, Chapter 4: Code Comfort. So it’s time for some coding. Nervous? But the advertisement says that: “Build fun games even if you’ve never coded before”. I guess this is the part that will decide whether a book can really teach someone to make a game. Well, it’s 37 pages of condensed lesson in scripting.

The question at the back of my head: do I really want to read about scripting?

*will rest a bit tonight, will take on that chapter tomorrow*

Next day, a new chapter. Chapter 4:  Code Comfort. Here we go! I’m just gonna read it through for and give you guys a short review of what I read.

*reads*

Okay, done. This chapter starts from the basics, in an easy to read and easy to understand way for the readers, whom the author assumes has no background at all in coding. For one thing, he compares functions to a hoagie, the curly brackets being the buns, and the scripts inside as well, the tomato, the salami, the mayo. And a variable to a bucket, which contains things, you know. He also teaches the readers how to access the Unity Manual and Scripting guide and how to make sense of it. He also lets the readers try out code every step of the way. All in all, the author is actually quite a fun read, because of his wit and humor, and it is nothing like my Computer Programming 1 professor, who tends to drone. So, I’m done with Chapter 4.

I do realize that this book has 380 something pages and 12 chapters. And this blog post will go on like forever If I continue in this fashion. So um, I’m going to stop here.

Overall, I think this book is easy read, it’s not intimidating in such a way that it bombards you with information, code bits that you can’t even begin to grasp. I think that beginners, even those who have “never coded before” would find this book easy to digest, and might even be able to “build fun games”. For those who are interested in the book, you can check it here. The book actual offers samples codes and projects that you can download even if you haven’t bought the book, here.

By the way, you can also read my review of Cocos2d for iPhone 0.99 Beginner’s Guide here. But my conclusion after reading that books is: “Overall, I think this book is a very comprehensive guide to anyone, who has a bit of background in programming, and wants to start making games using Cocos2D.” Note, I said that it will be a good guide to anyone with a bit of background in programming.

So can someone who has never coded before learn how to make games by reading a book? That was the question at the beginning of this blog post. I guess it’s hard to tell, I’ll have to say it’s:

( sign from Mythbusters)

By the way, Packt Publishing gave me these books for free to review. Why? It’ because I’m a blogger and I occasionally blog about Cocos2d stuff. You can get free books too, if you are a blogger/ webmaster/ reviewer for a magazine or a popular and relevant website / educator in an academic institution, just email you details to reviewrequest@packtpub.com. If you’re not those, you can also exchange an original article that you wrote of course, for a free book. More details on the Packt website.

Unity on Kongregate and Unity books

Uncategorized

Unity is a game engine for making awesome 3D games for multiplatforms, such as iPhone, Android, PC, Mac, Wii, XBox 360, PS3 and web (did I just mention most of the common platforms, I think I did).

Yup, you can build Unity games that run on the web. There have been a couple of Facebook games out there that are made using Unity, the first I can think of is the one with the Paintballs (what’s the title again?) Recently, okay, maybe last week, February 16, a contest on Kongregate just ended, it’s the Kongregate Unity Game Contest, and now, Unity games are also supported on Kongregate. So if you’re an Unity game dev, you can just toss some Unity games stuff there.

Okay, time for some advertising, two very close friends of mine, also joined the contest, so, here’s me showing them some love by sharing it with you guys.

Oh, to look for Unity games on Kongregate, just look at the Tags section, there’s a Unity tag, just click on that and go through, the hundreds of games there. I’m still trying to look for their game through that list.

Oklay, found it!

Must Get Candy

The description of the game from the site by my friend, Chris (kcannon):

You have an insatiable craving for candy causing you to run through candyland. Run for glory! Run for points!

Link: http://www.kongregate.com/games/kcannon/must-get-candy

So far, they had 232 plays, and some comments are:

I love this game, so addicting.

I don’t know why I keep playing this.


Is rare to see as a bear exploits for colliding with something, but the game is addictive

So, yeah, I am plugging, it’s like Robot Unicorn, but cuter, since it have a bear, and candy, also since my friend, Len, crammed some art assets on my laptop with the Wacom Pen and Touch she gave me.

Okay, enough about Kongregate.

For game devs who are just starting out with Unity or plans to switch to Unity, there are a couple of Unity books out there by Packt Publishing:

Unity 3D Game Development by Example Beginner’s Guide

It’s written by Ryan Henson Creighton.

According to the site:

Overview of Unity 3D Game Development by Example Beginner’s Guide

  • Build fun games using the free Unity 3D game engine even if you’ve never coded before
  • Learn how to “skin” projects to make totally different games from the same file – more games, less effort!
  • Deploy your games to the Internet so that your friends and family can play them
  • Packed with ideas, inspiration, and advice for your own game design and development
  • Stay engaged with fresh, fun writing that keeps you awake as you learn

Link: https://www.packtpub.com/unity-3d-game-development-by-example-beginners-guide/book

Unity Game Development Essentials

Written by Will Goldstone.

According to the site:

Overview of Unity Game Development Essentials

  • Kick start game development, and build ready-to-play 3D games with ease
  • Understand key concepts in game design including scripting, physics, instantiation, particle effects, and more
  • Test & optimize your game to perfection with essential tips-and-tricks
  • Written in clear, plain English, this book is packed with working examples and innovative ideas
  • This book is based on Unity version 2.5 and uses JavaScript for scripting

Link: https://www.packtpub.com/unity-game-development-essentials/book

So yeah, check those out!

End of Unity post here.