With the recent update to 4.3, Unity3D has added built in support for 2D projects. It is worth noting that this does not replace the 3D features, but rather supplements them, and almost all of these features come included with the Indie Version.
To create a new project in 2D, be sure to select Set up defaults for: 2D to tell the editor to assume you are working in 2D. Don’t worry, you can mix 2D and 3D or work in one even if you didn’t select this option.
Hashes in Ruby are a helpful way to organize information. As can be seen in the screenshot below, I’ve created a new hash, named it example, and given it a couple keys and values to start. To create your own hash, just pick the name you want it to be called and set that equal to Hash.new. Since Ruby is case-sensitive, it’s important to remember to capitalize Hash.new. To set keys and values, use the format: hashname[“key”] = “value”. In my example hash, I’ve created the keys “cold” and “hot” and given them values of “pluto” and “sun” respectively.
Next, you can get input from the user and add it to the hash as a key or a value.
Although we’re still trying to get Ruby on the Mac, I did get a chance to try it out on another computer. It’s very confusing to jump straight into it, although I do think that’s the best way for me to learn it. I read through the first bit of the chapter on Ruby in the “Seven Languages in Seven Days”, and I did understand a few things. Only a few, though, so my phrasing and understanding may be off. Continue reading
I have learned to do very basic commands with Codecademy and Why’s Poignant Guide to Ruby, but, more importantly, this week I learned how to write, save, and run scripts in Ruby. It was actually surprisingly difficult to figure it out, since nearly every source I combed through online just said to save a script with .rb, then type “ruby filename.rb” in terminal. With the lack of additional information, I did not know where I should write a script, what format it should be in, etc. It was only after a lot of trial and error and one very helpful video on youtube that I understood what needed to be done. This post will take you through the steps to write a ruby script and run in it the terminal. Continue reading