Thursday, 30 November 2017

KCB THIKA EYEWITNESS VERSION



The reality
Some criminals broke into KCB Thika branch by digging tunnel from adjacent building and into the strong room for the banks. They made away with 50 million Kenya shilling. The manager to the bank notified police the following day of the incident and some of the suspect were arrested with part of the money.

The Hilarious part of it
In November, man by the name …………. Claimed to be the witness into tragic death of Nyeri Governor. We now bring you the #eyewitness version of KCB Thika break in.

The Githeri media:  “Hey and what is your name?”

#Eyewitness:  “Am fine. Am ….. Working with security for the bank. Wacha niongee kwa Kiswahili ndio wakenya wanielewe. Mimi nafanya kazi kama bawabu wa hii bank. Nilikuwa nimekodisha chumba kwa hii nyumba karibu na hao vijana. Sasa wakaanza kuchimba na mimi pia nikaanza kuchimba! Nilikua nyuma yao. Wakichimba, tunachimba. Sasa walipofika kwa kifuniko ya strong room, huyo mmoja akapiga hiyo kifuniko ikasimama juu kama mtu! Wenye wanasema sijui walifunja, hawajui wanacho kisema. Hiyo tunnel ilichibwa saa tisa usiku.  

The Githeri media:  “What lead to this incident, sir?

#Eyewitness:  “Mimi na baba wa hawa vijana ndio tu tulikua hapo. Huyo kijana mmoja amefanya degree ya welding, huyo mwingine nasikia amafanya degree ya agriculture. Hao wengine ni watu wa mjengo. Hiyo talanta ikifanywa mix, vijana wanakua hatari! Saa tulikua internship. Mimi hapa nina degree ya witnessing.”

Prison break season 2017 continues shortly……

Lessons learnt:

1.       Technology is not above brain!
2.       Security starts with you. If CCTV couldn’t capture this incident then who can?
3.       Is our university education and skills not enough and of quality to secure good job?
4.       40 are the days of any criminal.
5.       Parents need to teach their children and not just educate them.

Help us add more below…….

Slobodan Praljak

Who is Slobodan?

He was born on 2nd January 1945 in Capljina. Had three university degrees. A professor, manager and theater director. In 1991, he joined Croatian Armed forces. In 1992, he became the major general after Sarajevo agreement. In 1983, he is accused of ordering destruction of Stari most causing  damage to the Muslim civilian. This was viewed as mass war crime against Muslims.
In 2004, he surrendered to ICTY (International Criminal Tribunal for the former Yugoslavia) after he was accused as senior military official, he directly and indirectly commanded armed forces to mass war crimes. Trial began in 2006 and on May 2013, he was sentenced to 20 years imprisonment. On 29th November, the ICTY found him guilty but some charges were overturned without reducing the 20 years jail term. This lead to his decision to take his own life after taking poison which was captured in the live broad cast. He died in hospital in Hague.

Here are his photos

May his soul rest in peace.

Wednesday, 22 November 2017

The Mugabe era in summary



Mugabe was born on 21st February 1924. He was prime minister of Zimbabwe from 1980 to 1987. He led Zimbabwe as president from 1987 to 2017. Mugabe started his career as a teacher. Between 1964 and 1974, he was imprisoned for sedition. On release he fled to Mozambique where he established Zanu, the party he has led for decades.

In 1980, he won general election to become the first prime minister of newly renamed Zimbabwe. In 1987, Zimbabwe parliament amended constitution to declare Mugabe as the executive president. He would go on to win all subsequent elections retaining his presidency.

Mugabe is famed to have had two wives. While married to Sally Hayfron, Mugabe had an extra-marital affair with Grace Marufu. In 1992, Sally died and Mugabe married Grace officially. On November 2017, Mugabe was placed under house arrest by ZNA army. On 19th November 2017, he was sacked as leader of ZANU-PF. This led to his resignation as president of Zimbabwe. There was celebration as his resignation letter was led in parliament. See the video here


Tuesday, 14 November 2017

Advancing game further

Previous: Marketing tips



As final step in our basic game development, we will add code to move the box right and left , add lose or win for better game play and generate box from random points. this clearly marks our levels but you can also do level based on another criteria say for every 100 boxes collected increase speed.

Add  variable to store how fast we move the box  
public float MovementSpeed = 1; //speed in meter per second

Add new vector variable  
Vector3 moveDir = Vector3.zero;
 


Add this to update
moveDir.x = Input.GetAxis("Horizontal"); // get result of AD keys in X
This get the horizontal x distance to move based on key pressed.
 
then move our box
transform.position += moveDir * MovementSpeed * Time.deltaTime;

 
 
You can test py pressing play button and use arrow keys
 
To support touch screen on android ,add the following variables
 
private Vector3 fp;

private Vector3 lp;

 private float dragDistance=0.2f;


 add this above 
transform.position += moveDir * MovementSpeed * Time.deltaTime; 
 code
 
See in the code below section for complete code
         #if UNITY_ANDROID || UNITY_IPHONE  // Cap letters
 
 
         #endif   
 
 
To check lose and win,  add a box below our catchup, enlarge to 
fill screen width and reduce height and call it loss and give it a 
tag loss

Add the new variable
int boxeslost =0; 
 
add the following in the update below


if (collid) {
if (boxdropped <= totalboxes) {
Instantiate(dropbox, new Vector2(0,2), Quaternion.identity);
}
collid = false;
}

if (GameObject.FindGameObjectWithTag ("box").transform.position.y < transform.position.y + 0.1) {
Destroy (GameObject.FindGameObjectWithTag ("box"));
collid = true;
boxeslost += 1;
}


You will be getting position of box and compare with catch up. 
If below, destroy and add boxes lost
 
 
Add this in GUI function


GUI.Label (new Rect (10,30, 300, 50), "Boxes lost: " + boxeslost);

  
 We now generate from random places
add new variable at start of update
int rand = Random.Range (-5,5);
 change our x value in
 Instantiate(dropbox, new Vector2(rand,2), Quaternion.identity); 

This is just a basic game. You can advance it further like adding
1. random movement downwards by changing x value
2. introduce obstacles and more



The complete code


using UnityEngine;
using System.Collections;

public class CatchBox : MonoBehaviour {
    int boxescollected =0;
    int boxeslost =0;
    int totalboxes =40,boxdropped=0;
    public GameObject dropbox;
    bool collid = false;

    private Vector3 fp;
    private Vector3 lp;
    private float dragDistance=0.2f;
    public float MovementSpeed = 1;
    Vector3 moveDir = Vector3.zero;

    // Use this for initialization
    void Start () {
        collid = true;

    }

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

        int rand = Random.Range (-5,5);
            if (collid) {
            if (boxdropped <= totalboxes) {
                Instantiate(dropbox, new Vector2(rand,2), Quaternion.identity);
            }
            collid = false;
        }

        if (GameObject.FindGameObjectWithTag ("box").transform.position.y < transform.position.y + 0.1) {
            Destroy (GameObject.FindGameObjectWithTag ("box"));
            collid = true;
            boxeslost += 1;
        }

        moveDir.x = Input.GetAxis("Horizontal"); // get result of AD keys in X


        #if UNITY_ANDROID || UNITY_IPHONE  // Cap letters

        if (Input.touchCount>0) // user is touching the screen with a single touch
        {
            Touch touch = Input.GetTouch(0); // get the touch
            if (touch.phase == TouchPhase.Began) //check for the first touch
            {
                fp = touch.position;
                lp = touch.position;
            }
            else if (touch.phase == TouchPhase.Moved) // update the last position based on where they moved
            {
                lp = touch.position;
            }
            else if (touch.phase == TouchPhase.Ended) //check if the finger is removed from the screen
            {
                lp = touch.position;  //last touch position. Ommitted if you use list

                //Check if drag distance is greater than 20% of the screen height
                if (Mathf.Abs(lp.x - fp.x) > dragDistance || Mathf.Abs(lp.y - fp.y) > dragDistance)
                {//It's a drag
                    //check if the drag is vertical or horizontal

                    if (Mathf.Abs(lp.x - fp.x) > Mathf.Abs(lp.y - fp.y))
                    {   //If the horizontal movement is greater than the vertical movement...
                        if ((lp.x > fp.x))  //If the movement was to the right)
                        { 
                            //Right swipe
                            // move box right    
                            MovementSpeed = MovementSpeed;
                        }
                        else
                        {   //Left swipe
                            // move box left
                            MovementSpeed = MovementSpeed * -1;
                        }


                    }
                    else
                    {   //the vertical movement is greater than the horizontal movement
                        if (lp.y > fp.y)  //If the movement was up
                        {   //Up swipe
                            // you can add code to move box up on advance levels to evade obstacle
                        }
                        else
                        { 
                            // you can increase speed to advance levels
                        }



                    }
                }
            }
            else
            {   //It's a tap as the drag distance is less than 20% of the screen height

                //you can tap code to attack obstacle and clear way on advance levels
            }
        }


        #endif

        transform.position += moveDir * MovementSpeed * Time.deltaTime;
    }



    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.tag == "box") {
            boxescollected += 1;
            Destroy (other.gameObject);
            collid = true;
        }


    }
    void OnGUI()
    {
        GUI.Label (new Rect (10,10, 300, 50), "Boxes collected: " + boxescollected);
        GUI.Label (new Rect (10,30, 300, 50), "Boxes lost: " + boxeslost);
    }


        
} 



Next: adding graphics