Girl Makes Games
Tuesday, April 21, 2015
Thursday, March 26, 2015
"Best Practices"
What does "Best Practices" mean in programming?
I would call them whatever works for the situation you are in at the time; however others have a code that they adhere to religiously, without considering the situation.
Don't do this. "Best Practices" are more guidelines than laws. Use them as such.
I would call them whatever works for the situation you are in at the time; however others have a code that they adhere to religiously, without considering the situation.
Don't do this. "Best Practices" are more guidelines than laws. Use them as such.
Friday, February 6, 2015
Unity: Character Controller: Planning and Psuedo Code
This tutorial Series is
for controlling a character in Unity.
I believe in creating reusable short
well documented code. If my class is over 200 lines of code, I
usually consider breaking it up into smaller segments so that I can have
an easier time when bug testing.
To this end the first step is
usually planning. When you begin you should consider what the object you're
making will have to do and what kind of functionality it will have.
For a character it will have:
1)To take input from the user.
2) be able to move
3) to detect collisions
4)to have gravity.
5) have a health system
6)to be able to attack
4)to have gravity.
5) have a health system
6)to be able to attack
7) a random generator (this is for
when attacking, if we want to give a chance for higher damage etc.)
8) power up
9)be able to animate
9)be able to animate
We will design these systems to
communicate between each other when necessary and also to be interchangeable;
that way when we are creating new objects, such as an enemy object further down
the line. We will be able to attach these same classes and just modify some of
the variables so that we are not starting from the beginning.
After we have listed what we want
the character to do we have to detail out each function we have listed and
create what is called "pseudo code". Pseudo code is a term used by
programmers to mean a class or function written out in English that plans the
logic behind the programming before actually beginning to type out any lines of
code.
We'll begin with the Input class.
When
the game updates
if input
is either up arrow or w key
move
the character forward.
if
input is either down arrow or s key
move
the character backward.
if
input is either a key or left arrow
turn
the character to the left.
if
input is either right key or d key
turn
the character to the right.
if
input is space bar
make
the character jump
if
input is right click
make
the character attack the current target.
If you look at the above bit of
"pseudo code" it doesn't looks so scary does it? That is because it
really is not. Coding is simply breaking harder tasks into smaller ones and
then figuring out how to make the game work exactly the way that you want.
Now that we've figured out what
exactly what we want to say we have to go line by line and decide how to turn
this pseudo code into actual code. That will be begun in the next tutorial. See you then.
Unity Intro
Unity is a powerful 3d game
development software that is free to download and use.
To begin navigate to: http://www.unity3d.com/
Although Unity is a free program you will need to create an account to finish installation of the program so let's go ahead and do this.
The create account button is in the top right under a drop down menu
You will then fill out a form with your personal information.
Although Unity is a free program you will need to create an account to finish installation of the program so let's go ahead and do this.
The create account button is in the top right under a drop down menu
Lastly there should've been a confirmation email sent to the email address you provided. Find this email and finish your registration.
Now we will download the most recent version of Unity; which as of this writing is version 4.6.1. go to http://www.unity3d.com/download
click the "download button.
click the "download button.
![]() |
| Unity's download page |
After finishing downloading and installing unity we will explore the functionality of this program a little and go through some terms you need to know.
The list of assets is:
GameObject
a GameObject is an empty thing, we can place things inside it or use it to organize our scene. Everything inherited from an object. This means all assets in Unity are GameObjects, but a GameObject is not all things.
Texture:
A texture is a 2d image or picture. Unity accepts many file formats JPEG, PNG, GIF, BMP, TGA, IFF, PICT, it also can import .psd (photoshop files)
Material
a material is the color we place upon objects, we can also apply textures to a material to give it a different appearance.
Mesh:
a mesh is the 3d object. It will not have actual color until we apply a material to it.
Text file:
a text files are sometimes used to read information from. Unity automatically accepts .xml and .txt files.
Scripts
Scripts are files that will change the actions of the GameObject, without scripts Unity would just be a really complicated art program.
Sounds
Sounds can be music or sound effects.
Particle effect
a particle effect are used to create special effects such as
The list of views is
Scene
This is the view we use to place objects in our games. If it helps you can think of it like the canvas that you will create your game upon. We are able to manually place objects by dragging them from the project browser to the scene.
Project Browser
This is a view that displays all of the assets that we have created. In it we can organize our files into folders and it also has a search function to make it easier to find specific files that we require.
Inspector
The inspector view shows the properties of the currently selected object. We can change values easily in this view such as scale and location as well as properties that we have assigned ourselves through code such as speed or gravity.
Hierarchy
This view shows the parent child relationship of objects. This means that if we apply something to the parent object; such as scale, the children objects will also scale.
Game
This view is called a WYSIWYG(wa-see-wig) or "What You See Is What You Get". This view is a preview of your finished game.
Assets:
Assets are the various items we will use to create our game. Without assets in our scene we would be looking at a blank grey screen.The list of assets is:
GameObject
a GameObject is an empty thing, we can place things inside it or use it to organize our scene. Everything inherited from an object. This means all assets in Unity are GameObjects, but a GameObject is not all things.
Texture:
A texture is a 2d image or picture. Unity accepts many file formats JPEG, PNG, GIF, BMP, TGA, IFF, PICT, it also can import .psd (photoshop files)
Material
a material is the color we place upon objects, we can also apply textures to a material to give it a different appearance.
Mesh:
a mesh is the 3d object. It will not have actual color until we apply a material to it.
Text file:
a text files are sometimes used to read information from. Unity automatically accepts .xml and .txt files.
Scripts
Scripts are files that will change the actions of the GameObject, without scripts Unity would just be a really complicated art program.
Sounds
Sounds can be music or sound effects.
Particle effect
a particle effect are used to create special effects such as
Views
There are several windows (called "views" in Unity and each one has a specific function. If you like you can also close views or open new ones and arrange them on the screen to meet your specific needs.The list of views is
Scene
This is the view we use to place objects in our games. If it helps you can think of it like the canvas that you will create your game upon. We are able to manually place objects by dragging them from the project browser to the scene.
Project Browser
This is a view that displays all of the assets that we have created. In it we can organize our files into folders and it also has a search function to make it easier to find specific files that we require.
Inspector
The inspector view shows the properties of the currently selected object. We can change values easily in this view such as scale and location as well as properties that we have assigned ourselves through code such as speed or gravity.
Hierarchy
This view shows the parent child relationship of objects. This means that if we apply something to the parent object; such as scale, the children objects will also scale.
Game
This view is called a WYSIWYG(wa-see-wig) or "What You See Is What You Get". This view is a preview of your finished game.
Okay now that we understand what a Unity file can possibly contain let's dive in and create our first scene to put into practice what we have just talked about.
Sunday, January 25, 2015
Laravel 1
Laravel tutorial 1
I've noticed that most Laravel tutorials are fairly complicated, so I've decided to write notes for myself so that I can have a reference.
Chapter 1 How to install.
Before you can install Laravel, you must first install what is called a LAMP environment which is a system that helps you handle the different languages and components.
My two suggestions are
WAMP which we will be using http://www.wampserver.com/en/
XAMPP which is for windows linux and mac https://www.apachefriends.org/index.html
Both of these handle about the same. By downloading and installing them you are also installing PHP and any other languages you need to create your local database network.
After you have installed your Wamp Server you will want to install Composer https://getcomposer.org/doc/00-intro.md
Composer is a software that handles many functions inside of laravel.
For windows you can use the composer installer, which is available on their website. The installer will ask for the location of "php.exe" and for wamp servers that location will be C:\wamp\
bin\php\php.5.1 (or whatever version of php you have).php.exe
for other os systems to install composer it appears like you must open up your terminal and type this line
php -r "readfile('https://getcotmposer.org/installer');" | php
This should install composer on your computer. I will be testing this out later on my mac mini when I get some free time and get back to this.
after composer is installed open your comand prompt and type this line
I've noticed that most Laravel tutorials are fairly complicated, so I've decided to write notes for myself so that I can have a reference.
Chapter 1 How to install.
Before you can install Laravel, you must first install what is called a LAMP environment which is a system that helps you handle the different languages and components.
My two suggestions are
WAMP which we will be using http://www.wampserver.com/en/
XAMPP which is for windows linux and mac https://www.apachefriends.org/index.html
Both of these handle about the same. By downloading and installing them you are also installing PHP and any other languages you need to create your local database network.
After you have installed your Wamp Server you will want to install Composer https://getcomposer.org/doc/00-intro.md
Composer is a software that handles many functions inside of laravel.
For windows you can use the composer installer, which is available on their website. The installer will ask for the location of "php.exe" and for wamp servers that location will be C:\wamp\
bin\php\php.5.1 (or whatever version of php you have).php.exe
for other os systems to install composer it appears like you must open up your terminal and type this line
php -r "readfile('https://getcotmposer.org/installer');" | php
This should install composer on your computer. I will be testing this out later on my mac mini when I get some free time and get back to this.
after composer is installed open your comand prompt and type this line
composer global require "laravel/installer=~1.1"
this will install laravel on your computer.
Tuesday, September 30, 2014
Back
Hey, I got a job working for contract company where I create training games. So I've been kind of burnt out on doing my own projects after coding and doing art all day.
I do want to try and start publishing here more frequently though. Right now I'm also studying for Japanese certification N3 test. I thought about doing the harder N2, but I actually would like to have a life over the next 3 months. I've almost passed the N3 before, I think I was like 10 points away from a pass, so it shouldn't be that hard to improve 10 points.
Anyway, I'll try to write something new tonight.
I do want to try and start publishing here more frequently though. Right now I'm also studying for Japanese certification N3 test. I thought about doing the harder N2, but I actually would like to have a life over the next 3 months. I've almost passed the N3 before, I think I was like 10 points away from a pass, so it shouldn't be that hard to improve 10 points.
Anyway, I'll try to write something new tonight.
Subscribe to:
Comments (Atom)




