Don’t Fall Asheep Progress 2013-04-18

Don’t Fall Asheep Progress:

Finally got around to start on the mock-ups for the project, but first I created the basic Unity setup and copied reusable scripts from the “Do No Harm” project. Then I made a small batch script that creates my basic folder structure, so I don’t have to create it every time I start a new project.

Drew a few texture items to be able to try out some ideas. Without some textures, I find it very hard to gent a good camera angle for the game and how big the game area should be.

Don't fall asheep MainTexture
Don’t fall asheep MainTexture

Created a basic Sheep in Blender and discarded it, I still don’t know if I’m going to do the game in 2D, 2.5D or 3D.
Made Player script to be able to fire spheres into the scene and sheep script to allow the user to “kill” it, by hitting it 3 times.

Player script:

    void Update()
    {
        if (Input.GetMouseButtonDown(0))// || Input.GetMouseButton(0))
        { // only do anything when the button is pressed:
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 1000))
            {
                Vector3 handPosition = transform.position;
                handPosition.x += 0.5f;
                GameObject projectile = (GameObject)Instantiate(bullet, handPosition, Quaternion.identity);
                // turn the projectile to hit.point
                projectile.transform.LookAt(hit.point);
                // accelerate it
                projectile.rigidbody.velocity = projectile.transform.forward * 20;
            }
        }
    }

Sheep Script:

  private int hitsLeft = 3;

    void OnCollisionEnter(Collision collision)
    {
        GameObject.Destroy(collision.collider.gameObject);
        hitsLeft -= 1;
        if (hitsLeft <= 0)
        {
            GameObject.Destroy(gameObject);
        }
    }

 – Henning

Leave a Reply

Your email address will not be published. Required fields are marked *