Thursday, 11 August 2011

CHINA

Okay first of all, i changed the hats for the character in China

 Egypt

China















The the camera lag when it follows the player so it wont appear static.

this is the script;
// Update is called once per frame
    void Update()
    {
        float y = player.transform.position.y;
        float old = this.transform.position.y;
        float nu = Mathf.Lerp(old,y,Time.deltaTime *4);

        this.transform.position = new Vector3(0, nu, 0);

And lastly,
GAME DESIGN FOR CHINA!

The China Level is much harder and longer thats why it is well deserved for players who complete egypt.


CONCLUSION!
I had a very fun experience making this game. it was hard at first with alot of coding involved as i really hate coding. but all in all unity is very easy and fun to learn and i wish to gain more learning experiences and learn alot more in coding for my visual effects. I realized the importance of coding.

Would like to thank Mr Ron Bernard for helping the group and myself in making this wonderful game.





We're moving on!

Okay we finally get the movement to work with the other scripts and i added the power ups and power downs for the other items like the crown, the energy bar and the spikes.

these are the public floats for the player;

 public float jumpForce = 600;
    public float starForce = 20;
    public float powerForce = 30;
    public float saboForce = -20;
    public float slowDown = 5;

I tagged them to the different items

if (other.tag == "powerup")
        {

            this.rigidbody.velocity = new Vector3(0, powerForce, 0);
            score++;
            StartCoroutine(blast(Booster));
            Destroy(other.gameObject);
        }

        if (other.tag == "powerdown")
        {

            this.rigidbody.velocity = new Vector3(0, saboForce, 0);
            score--;
            Destroy(other.gameObject);
        }

        if (other.tag == "multipoint")
        {

            this.rigidbody.velocity = new Vector3(0, starForce, 0);
            score+= score;
            Instantiate(SparkleCrown, this.transform.position, Quaternion.identity);
            Destroy(other.gameObject);
        }

        if (other.tag == "slowdown")
        {

            this.rigidbody.velocity = new Vector3(0, slowDown, 0);
            score--;
            Destroy(other.gameObject);




power up will be the Energy Bar











power down will be the Spikes








multipoint will be the Crown












slowdown will be the boots













I added a platform so when the player wins he could stay on top to bask on his victory!
I use the same script as the OnTriggerStay function on the top plane.





























And also designing of the map.

TAKYAA EGYPT!

































Thats it for now, Next stop, NEXT LEVEL!

Prototype viewing 1

Ive done the move script for the player. for it to be able to jump and hit the stars

This is the move script

i made it move by putting on a script which is;

    void Update ()
   
    {
        float x = Input.GetAxis("Mouse X") ;

        this.transform.position = new Vector3( Mathf.Clamp(x + this.transform.position.x, edge, -edge),
                                                this.transform.position.y,
                                                0);
basically the character will be controled by the mouse.

i added a plane made prevented double jumping with;

void OnTriggerStay(Collider other)
   {
       if (Input.GetButtonDown("Jump"))
       {
           this.rigidbody.AddForce(transform.up *jumpForce);
       }

this is the On trigger stay function which prevents double jumping.

This is the function that make the player boost up when colliding the star;

   void OnTriggerEnter(Collider other)
    {

        if (other.tag == "star")
        {

            this.rigidbody.velocity = new Vector3(0, starForce, 0);

Then the Spawning of the star;
  #region Start
    // Use this for initialization
    void Start()
    {

        for (int i = 1; i <= 50; i++)
        {
            Instantiate(star, transform.position, transform.rotation);
        }
    }


For now this works.
But when we combine the move script together with my group mades other script, it goes hay wire so For now this will do.

What i did to for testing;