Tuesday, May 21, 2013

Learning Python(Pt II)


lloyd = {
    "name": "Lloyd",
    "homework": [90, 97, 75, 92],
    "quizzes": [88, 40, 94],
    "tests": [75, 90]
}
alice = {
    "name": "Alice",
    "homework": [100, 92, 98, 100],
    "quizzes": [82, 83, 91],
    "tests": [89, 97]
}
tyler = {
    "name": "Tyler",
    "homework": [0, 87, 75, 22],
    "quizzes": [0, 75, 78],
    "tests": [100, 100]
}

students = [lloyd, alice, tyler]

def average(x):
    return sum(x) / len(x)
def get_average(x):
    return (average(x["homework"]) * 0.1 +
    average(x["quizzes"]) * 0.3 +
    average(x["tests"]) * 0.6)

def get_letter_grade(score):
    score = round(score)
    
    if score >= 90:
        return "A"
    elif 80 <= score < 90:
        return "B"
    elif 70 <= score < 80:
        return "C"
    elif 60 <= score < 70:
        return "D"
    elif score < 60:
        return "F"
    
print get_letter_grade(get_average(lloyd))

def get_class_average(students):
    n = 0
    for each in students:
        n+=get_average(each)
    return n/len(students)
    
print get_class_average(students)

Here is some of the code I've been doing on codecademy. Basically this code consists of 3 dictionaries containing students grades, then there are 4 functions that do different things such as: finding the average grade for a student, finding the weighted average for the student, then finding the letter grade, then finding the overall letter grade. Python is actually not that difficult compared to javascript.

Wednesday, May 15, 2013

Learning Python(I guess)

Completed the first little tutorial on codecademy on python. Pretty fun and easy, similar to javascript so far except for the fact that whitespace is important in python.

Thursday, May 2, 2013

GUI :D

I have been making all the GUI in the game recently and it's been awesome. A nice break from coding all the time. Here are just a few examples of the different stages of the back button, but all of the buttons have similar stages. I've also been making the signage for the game, which is the last picture. We didn't want to use any words on the signs so we used pictures instead. 








Monday, April 29, 2013

Tuesday, April 9, 2013

SkillsUSA Project

Our final video for the stupid duck animation. We fixed up the audio from the last one and alot of the animation at the end. I'm so happy to be done with this thing. :c

Coding Superpowers


#pragma strict
 var player = GameObject.Find("rockman");
 var speed =  0.001;
 var isGrounded : boolean;
 var ballRoll : boolean = false;

         function Update ()
         {
   var characterController = GetComponent(CharacterController) as CharacterController;  
       
    if(Input.GetKey("down") || Input.GetKey("s") && characterController.isGrounded)
    { 
    ballRoll = true;
    characterController.height = 0.00001;
    characterController.center = Vector3(0,0,0);
    characterController.radius = 0.011;
      }
    
    else if((ballRoll == true) && (Input.GetKey("up") || Input.GetKey("w")))
    {
    player.transform.Rotate(0, Time.deltaTime, 0, Space.World);
    player.transform.Translate(0, 1, speed);
    //Move the object upward in world space 1 unit/second.
    player.transform.Translate(0, speed, 0, Space.World); 
    characterController.height = 0.038;  
    characterController.center = Vector3(0,0,0);
    characterController.radius = 0.006;
    ballRoll = false;
       } 
      

Me and Dakota made this code from scratch and we had a million errors with it at first but we finally fixed everything. I'm surprised that the script turned out so well, now our issue is with the animation for this superpower. So, it seems like Codecademy actually taught me a ton of javascript because I completely understand this script, it's awesome. :D

Walker Boys Course

http://walkerboystudio.com/html/unity_course_syllabus.html

So, I've decided to start working on this cool course to get a certificate in Unity3D, I've completed the first 2 exams so far. They were actually more challenging than how I expected them to be. Sometime this week I plan on starting the next portion of the course, which is Javascript in Unity.

Tuesday, February 26, 2013

More Coding

So I've actually been working on a combination of codecademy and watching a very useful Digital tutors video on coding in Unity.
http://www.digitaltutors.com/11/training.php?vid=12817&autoplay=1
http://www.codecademy.com/courses/javascript-beginner-en-NhsaT/0?curriculum_id=506324b3a7dffd00020bf661#!/exercises/4

I finished my rock paper scissors game and now I am learning about the different kinds of loops, such as for and while. In the digital tutors video, it discusses the basics of coding in Unity and points out a few of the differences between regular javascript and Unity's. It taught me how to make a simple move and jump script, along with tips on making your own scripts. Also, it really shows the importance of using the Unity script reference religiously to answer any questions. For the video tutorial, I'm just taking a bunch of notes and trying to absorb as much information about Unity scripting as I can.

Wednesday, February 13, 2013

Coding Tutorials

I've been learning Javascript on Codecademy. In the current tutorial I'm doing, I am making a simple rock paper scissors game involving a ton of If/else if/else statements and I've also learned how to make variables and functions. This website is so fun and I'm learning a ton of stuff about coding. Now when making our game I can kind of understand what is going on with coding.

http://www.codecademy.com/tracks/javascript


var userChoice = prompt("Do you choose rock, paper, or scissors?");
var computerChoice = Math.random();

if (computerChoice <= 0.33)
{
computerChoice = "rock";
}
else if (0.34 < computerChoice && computerChoice <=0.66)
{
computerChoice = "paper";
}
else 
{
computerChoice = "scissors";
}
console.log(computerChoice);


Here is a part of the code for the game, and basically the computer pick a random number between 0 and 1, and then I made a statement so that if the code is between a certain range, it will pick either rock, paper, or scissors. And it also prompts the user on what they pick.

Wednesday, January 23, 2013

Fur Tutorial in Maya

http://www.digitaltutors.com/11/training.php?pid=264

So I used this tutorial to learn a little bit about fur before diving into applying fur to a duck. So I decided to use the default fur called duckling. To apply the baldness in areas such as beak, eyes, and feet, I created a UV map for my duck, then took that UV map into photoshop and colored the bald areas black. Then I connected that file to the baldness attribute in the fur node. I also adjusted the global scale to fit the duck model.

Wednesday, January 16, 2013

Skills Room


Our skills project. Used photon lighting, where there is basically a directional light emitting light and an area light emitting the photons in the scene. The floor looks a little too reflective but that's an easy fix. The duck and cardboard box haven't been placed in yet either. I'm thinking about adding another light to the scene to lighten the mood a bit.