Mastery 14 – OO and Agile

--Originally published at Sierra's Blog

Agile life cycle works like this:

agile

https://number8.com/common-mistakes-using-agile-method/

It is a new way to see the development team, Agile is flexible, doesn’t have guidelines, creativity is valued, there is freedom to fail.

Agile believes that the team is aware of their responsibilities and that they will the necessary and adequate things in order to accomplish their tasks.

Scrum adapts this beliefs in the development process, a sprint meeting is about the desired output, not about the how since the software developers are the experienced members of the team that actually knows what should they do to correctly get the output.

This methodology also allows that the whole team decides what to do, there’s not a leader selecting tasks among subordinates. Nonetheless, there is a leader role called the Scrum Master which will led the team and supervise if they are following the scrum methodology correctly. In addition, there’s one extra position called the product owner which represents the business, customer or user and its main job is to led the team towards developing the correct tool.

sprints are time segments that could last between one week and no more than one month.

At the start of the sprint, there is a meeting were the objectives of the sprint are selected and the team members commit to aboard them. At the end, a registry that contains the tasks that are going to be done during that sprint is generated.

After the initial meeting, the team participate daily in a 15 minutes long meeting to keep track of who is doing what and what has already been done.

 

References

https://number8.com/common-mistakes-using-agile-method/

http://www.mountaingoatsoftware.com/agile/scrum

C#

--Originally published at Sierra's Blog


CLASS 1

//se ejecuta una vez al iniciar el gameobject

//no se sabe el orden de ejecución

void Awake(){

}

 

//se ejecuta después de todos los awake

//úsalo para inicialización

void Start(){

}

 

//se ejecuta una vez por frame

//pon aquí entradas de usuario y movimiento

void Update(){

}

 

void LateUpdate(){

}

 

//corre en un framerate fijo

void FixedUpdate(){

}


Class2 Collisions

// reference to other components
// all components have a corresponding class
private Transform t;
// atributos públicos
// primitivos y clases de unity pueden ser modificadas desde editor
public float velocidad;

//public GameObject go;
public Text text;

private Vector3 pos;

// Use this for initialization
void Start () {

// this can return null!!!! 
// whenever you do this do it the least times possible
t = GetComponent<Transform> ();

// go = GameObject.Find (“Text”);
// text = go.GetComponent<Text> ();
text.text = “HOLA, SÍ JALÓ”;
pos = transform.position;
}

// Update is called once per frame
void Update () {

//t.Translate (0.01f, 0, 0);
// first issue – speed 
// Time.deltaTime – keeps track of how much time passed since last frames

// input – 2 ways to catch input
// – directly pole from device
if(Input.GetKeyDown(KeyCode.A)){
//print (“KEY DOWN!”);
}

if (Input.GetKey (KeyCode.A)) {
//print (“JUST KEY.”);
}

if (Input.GetKeyUp (KeyCode.A)) {
//print (“KEY RELEASED!”);
}

if (Input.GetMouseButtonDown (0)) {
print (Input.mousePosition);
}

// – through axes (plural of axis)
float h = Input.GetAxis(“Horizontal”);
float v = Input.GetAxis (“Vertical”);
//print (h);

transform.Translate (h * velocidad * Time.deltaTime, v * velocidad * Time.deltaTime, 0, Space.World);
}

void OnCollisionEnter(Collision c){
print (c.contacts [0].point);
print (c.gameObject.transform.name);

}

void OnCollisionStay(Collision c){
//print (“stay”);
}

void OnCollisionExit(Collision c){
print(“exit”);
}

void OnTriggerEnter(Collider c){
print (“ENTER”);
Destroy (c.gameObject);
transform.position = pos;
}

void OnTriggerStay(Collider c){

}

void OnTriggerExit(Collider c){

}


Class 3 Physics

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Brick : MonoBehaviour {

private Rigidbody rb;

// Use this for initialization
void Start () {

rb = GetComponent<Rigidbody> ();
Invoke (“Explotar”, 2);
}

// Update is called once per frame
void Update () {

}

void Explotar () {

rb.AddExplosionForce (2000, Vector3.zero, 10);
print (“si jala”);
}
}

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour {

// retrieving a reference to a component
private Rigidbody rb;

// Use this for initialization
void Start () {

// this can always return null
rb = GetComponent<Rigidbody> ();

// -20
rb.AddForce (100 * transform.up, ForceMode.Impulse);
Destroy (gameObject, 3);
}

// Update is called once per frame
void Update () {

}
}

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cannon : MonoBehaviour {

public GameObject originalBullet;
public Transform punta;

// Use this for initialization
void Start () {
StartCoroutine (EjemploDeCorutina ());
}

// Update is called once per frame
void Update () {

float h = Input.GetAxis (“Horizontal”);

transform.Translate (0, 0, h * Time.deltaTime * 5);

if(Input.GetKeyUp(KeyCode.Space)){

// do the shooting.
// instantiate – clone an object
// we need a reference to the original
//Instantiate(originalBullet);
// rotation – Quaternion – vector de 4 valores, expresa rotacion en un espacio tridimensional
Instantiate(originalBullet, punta.position, transform.rotation);
}
}

// coroutine – NO es concurrencia (pero parece!)
// pseudohilos
IEnumerator EjemploDeCorutina(){

while (true) {
yield return new WaitForSeconds (0.1f);
print (“hola”);
Instantiate(originalBullet, punta.position, transform.rotation);
}
}
}


 

Class4 KEN SPRITES

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Hadouken : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
transform.Translate (-7 * Time.deltaTime, 0, 0, Space.World);
}
}

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Ken : MonoBehaviour {

public GameObject hadouken;
public Transform referencia;

private Animator a;
private float jAnterior;

// Use this for initialization
void Start () {
a = GetComponent<Animator> ();
jAnterior = 0;
}

// Update is called once per frame
void Update () {
float h = Input. Continue reading "C#"

My review of the course!

--Originally published at Sierra&#039;s Blog

Hello everyone, the day has arrived…

today is the last day of my first semester at tecnológico de Monterrey and the last day of tc101 course, so I just want to leave my opinion about this course and I hope Ken sees it:)

To Ken Bauer class style:

I consider this classroom concept extremely different compared to other teacher’s methods – not better or worse- just different, with pro’s and con’s.

A very cool advantage that this method gives is the free to progress at your very own pace and way. But I personally think that this becomes with another great disvantage which in an utopic world shouldn´t be a problem but sadly it actually exists: the lack of a time limit which could force you to work harder and faster doesn’t exist.

I only recommend this course to the people that are very responsible for their own learning and doesn’t need someone to force them to work, or to those who wish to be one of this kind of people and want to take the course as a challenge of taking responsability.


Validated user input (ensure correct/expected data entry)

--Originally published at Sierra&#039;s Blog

there are many options to validate a user input, i’ll show you some of them:

user1 = input(“digite un numero: “)
while user1.isdigit():
print(“cool”)
break
else:
print(“bad”)
isdigit is a function that checks if the input is a number or a string, if it’s a number it will return the value “true”.

this works like this:

while True:
UserChoice = input(“give me the value: “)
try:
IntUserChoice = int(UserChoice)       #if it’s an int then return the value
return IntUserChoice
except ValueError:                                   #if it’s not, then choose another number
print(“Error, elige un número”)

it works the same with “isalpha” function:

user1 = input(“digite una cadena: “)
while user1.isalpha():
print(“cool”)
break
else:
print(“bad”)

 


Reading and writing of text files

--Originally published at Sierra&#039;s Blog

How to create and read a text file:

Note:

“r” = read

“w” = write

“a”=add

the first line needs to be written necessary to work inside the text.

the second line format is used to write inside the text.

the third line will close the text.

the fourth line is used to open the text, the difference between the first and the fourth line is that the first line opens the text and let you modify it while the fourth line is only used to read it.

the fifth line is only going to print the text.

readingtextfiles

you should watch this video to learn more about this topic:

 

 

 


When to use what type of repetition in a program

--Originally published at Sierra&#039;s Blog

There are two types of repetitions in python: For and while.

For loops are used when you have the idea of how much times you need to repeat the code, while the while loop is used when you don’t have a single clue of how much time do you need to repeat it.

for loops will continue until a a variable reaches the desired number, for example:

for i in range(0,10):

print(“hi”)

this will print the word “hi”10 times because the value of the variable “i”will be i+1 every time the loop ends and the loop has the order to stop when the letter i becomes 10.

min = 10

max = 20

while min!=max:

print(“hi”)

min = min+1

max = max-1

the loop while will only stop when the statement min!=max becomes false. This will print the word “hi” 5 times.

As you can see, the while loops are used when the number of times that you need to repeat the code isn’t known by us.


Creating libraries/modules

--Originally published at Sierra&#039;s Blog

A module is a file saved as .py

When you create a new file you’re actually creating potentially a new librarie.

i’ll explain it with some examples:

creatinglibraries

this is a new file saved as ejemplo1.py, in this file i¿m importing a file that I already create called vectores.py. By importing it, now i’ll be able to use all the functions that I created in vectores.py, in this example im using the function called bienvenida, which welcomes the user and tells you what does the program do.

to make this work you need this format:

1.- import the file were the functions are. (in this case Vectores.py)

2.- to call a function of vectores.py you need to write with this format: name_of_the_file”.”name_of_the_function(parameters).(in this case: Vectores_bienvenida()<- no parameter).

Conclusion: everytime you create a new file you’re creating a new librarie to use.

 


Strings

--Originally published at Sierra&#039;s Blog

Hello everyone! Today i’m gonna talk about strings.

Strings in python let you store letters and numbers in a variable.

 

the_string = “example”

this orders python to save, in the variable called the_string, the characters e x a m p l e, so, if you ask python to print this, it will print the word “example”.

strings1

don’t make this mistake, python use the symbol (“) to understand that what you’re typing is a string, so, if you ask python to print the variable inside “” it will only print the name of the variable.

you should look at this page for more information about strings: https://docs.python.org/2/library/string.html

here’s also a video that might help you: