Tuesday, September 21, 2010
Week 11
There wasn't anything assigned for programming and this quarter is the only time I'll be in programming so no more for me. No assignments was assigned for marketing as well. I had to do one cycle of my choosing for animation so I did a stealth walk. It wasn't so bad, the rig I did wasn't complete so some of the controls are a bit off. Overall, I'm happy with the results of the cycle.
Tuesday, September 14, 2010
Week 10
I tried to finished up some GUI scripts I had left over. I fixed the GUI background to display a background for better visiability. It is possible to texture it if we choose to customize it.
I removed the GUIStyles from the the GUI.Box. I had to leave the empty quotes or it would say the script doesn't work with unity.
GUI.Box(Rect (0, 0, Screen.width, Screen.height), " ");
I can add a GUIStyle later if we choose to style it. It's mainly there to darken the screen a bit so the players know it is being paused. I adjust the padding variables so we could give spacing along the edges of the buttons. With in the script file, I adjust the layout area size to be more acceptable. It took some tinkering around. Mainly because I didn't noticed these options right away when I was looking for them.
I moved the layout more to the left to make use of the padding.
GUILayout.BeginArea (Rect(Screen.width/2 - 50, Screen.height/2 - 50, 450, 70), boxFilter);
The script above was the original script. I changed the 50 in the Screen.width to 200.
GUILayout.BeginArea (Rect(Screen.width/2 - 200, Screen.height/2 - 50, 450, 70), boxFilter);
After that was done, I created a transparent white background for the layout box to use for better visibility. I've done the same to the menu script.
GUI.Box(Rect (0, 0, Screen.width, Screen.height), "");
GUILayout.BeginArea (Rect(Screen.width/2 - 50, Screen.height/2 - 200, 145, 275), boxFilter);
GUILayout.BeginVertical();
Time.timeScale = 0.0;
GUILayout.Button("Menu", menu);
GUILayout.Space(spacing);
if(GUILayout.Button("Continue", continueStyle))
When it came to the health bar, I had a hard time getting started. I did some research and read up that I could do the heatl using gui boxes. I looked up gui boxes at Unity3D and tinkered around a bit. What I ended up doing is create a gui box that will represent the health and place another box into it and have that represent diminishing health. Sound simple enough but when I tried doing it, the boxes wasn't aligned to each other.
GUI.BeginGroup (new Rect (pos.x, pos.y, size.x, size.y));
GUI.Box (Rect (0,0, size.x, size.y), healthBarFull);
GUI.BeginGroup (new Rect (0, 0, size.x, size.y * healthLeft));
GUI.Box (Rect (0,0, size.x, size.y),healthBarEmpty);
GUI.EndGroup ();
GUI.EndGroup ();
The first group is the position of the whole box and its size. I didn't know there was vector2 in unity and have been using vector3 so it kept moving around when i rotate. vector2 keeps the gui flat on a 2d dimension with the camera. A new thing I learned or understand further is float. float allow the variable to sort of speak, hang around and remain viable for use. when you dont put float into the variable, it will set the variable as it is, even if you change it with a trigger in the script, it stops working right after.
function Update()
{
healthLeft = counter;
if (Input.GetKey ("t"))
{
counter = Time.time * 0.05;
weird thing is I had to have state/use healthLeft within the function update otherwise the healthFull texture will not sure up. No matter how I change it, if it's not being stated in the function it won't show up. I can't figure out why. To make sure it works I had to think of a way to trigger being hit. I set it so when you hit "t" it will trigger the health drain. However I can't have it drain until there is a variable that is incrementally multiplying with a set number to so the decrease in health. if you dont do this then it will just drain once and wont drain more. ex. if you got hit for 2 dam, it will show that you lose 2 hp. if you get hit for 2 dam again, it wont lose anymore health since 2 hp has already been lost. you have to build that dam intake number. 2 + 2 = 4 dam will make you lose health beyond the first 2 dam. So in this case, i set it up to multiply with time since its always increasing as you play the game and you lose like as you hit "t"
Besides programming, I've done the 5 sets of storyboards for marketing. Hopefully its good enough with everyone.
I removed the GUIStyles from the the GUI.Box. I had to leave the empty quotes or it would say the script doesn't work with unity.
GUI.Box(Rect (0, 0, Screen.width, Screen.height), " ");
I can add a GUIStyle later if we choose to style it. It's mainly there to darken the screen a bit so the players know it is being paused. I adjust the padding variables so we could give spacing along the edges of the buttons. With in the script file, I adjust the layout area size to be more acceptable. It took some tinkering around. Mainly because I didn't noticed these options right away when I was looking for them.
I moved the layout more to the left to make use of the padding.
GUILayout.BeginArea (Rect(Screen.width/2 - 50, Screen.height/2 - 50, 450, 70), boxFilter);
The script above was the original script. I changed the 50 in the Screen.width to 200.
GUILayout.BeginArea (Rect(Screen.width/2 - 200, Screen.height/2 - 50, 450, 70), boxFilter);
After that was done, I created a transparent white background for the layout box to use for better visibility. I've done the same to the menu script.
GUI.Box(Rect (0, 0, Screen.width, Screen.height), "");
GUILayout.BeginArea (Rect(Screen.width/2 - 50, Screen.height/2 - 200, 145, 275), boxFilter);
GUILayout.BeginVertical();
Time.timeScale = 0.0;
GUILayout.Button("Menu", menu);
GUILayout.Space(spacing);
if(GUILayout.Button("Continue", continueStyle))
When it came to the health bar, I had a hard time getting started. I did some research and read up that I could do the heatl using gui boxes. I looked up gui boxes at Unity3D and tinkered around a bit. What I ended up doing is create a gui box that will represent the health and place another box into it and have that represent diminishing health. Sound simple enough but when I tried doing it, the boxes wasn't aligned to each other.
GUI.BeginGroup (new Rect (pos.x, pos.y, size.x, size.y));
GUI.Box (Rect (0,0, size.x, size.y), healthBarFull);
GUI.BeginGroup (new Rect (0, 0, size.x, size.y * healthLeft));
GUI.Box (Rect (0,0, size.x, size.y),healthBarEmpty);
GUI.EndGroup ();
GUI.EndGroup ();
The first group is the position of the whole box and its size. I didn't know there was vector2 in unity and have been using vector3 so it kept moving around when i rotate. vector2 keeps the gui flat on a 2d dimension with the camera. A new thing I learned or understand further is float. float allow the variable to sort of speak, hang around and remain viable for use. when you dont put float into the variable, it will set the variable as it is, even if you change it with a trigger in the script, it stops working right after.
function Update()
{
healthLeft = counter;
if (Input.GetKey ("t"))
{
counter = Time.time * 0.05;
weird thing is I had to have state/use healthLeft within the function update otherwise the healthFull texture will not sure up. No matter how I change it, if it's not being stated in the function it won't show up. I can't figure out why. To make sure it works I had to think of a way to trigger being hit. I set it so when you hit "t" it will trigger the health drain. However I can't have it drain until there is a variable that is incrementally multiplying with a set number to so the decrease in health. if you dont do this then it will just drain once and wont drain more. ex. if you got hit for 2 dam, it will show that you lose 2 hp. if you get hit for 2 dam again, it wont lose anymore health since 2 hp has already been lost. you have to build that dam intake number. 2 + 2 = 4 dam will make you lose health beyond the first 2 dam. So in this case, i set it up to multiply with time since its always increasing as you play the game and you lose like as you hit "t"
Besides programming, I've done the 5 sets of storyboards for marketing. Hopefully its good enough with everyone.
Tuesday, September 7, 2010
Week 9
I practiced rigging using the model from rigging class. I wasn't sure if Chris wanted us to use the model in the drop box to rig so I tried to rig that without notes to see how much I remember. I turned in my assignment for marketing into the dropbox at Robin's request.
Subscribe to:
Posts (Atom)