viernes, 15 de octubre de 2021

C# scripts del videojuego THE OLYMPIC SNIPER;

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

public class baadepositoexplota21 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "depositoexplota") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (21);




            }
        }
    }
 

 

------------------------------------------------------------------------------------------------------------------------

 

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

public class badepositoexplota22 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "depositoexplota2") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (22);




            }
        }
    }

 

--------------------------------------------------------------------------------------------------------------------------

 using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;/// <summary>
public class cabiodeescenanivel0en25segundos : MonoBehaviour {


        public Text contador1;
        public Text fin1;
        private float tiempo = 25f;
        // Use this for initialization
        void Start () {
            contador1.text = " " + tiempo;
            fin1.enabled = false;




        }

        // Update is called once per frame
        void Update ()
        {
            tiempo -= Time.deltaTime;
            contador1.text = " " + tiempo.ToString ("f0");
            if (tiempo <= 0) {
                contador1.text = "0";
                fin1.enabled = true;



                {




                    Destroy (gameObject, 0.0f);

                    {

                        //Application.LoadLevel (1); ESTE ES EL ORIGINALLLLLLL

                        Application.LoadLevel (0);


                    }
                }
            }
        }

    }

--------------------------------------------------------------------------------------------------------------------------

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

public class cambia28portaga28 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "a28") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (28);




            }
        }
    }


---------------------------------------------------------------------------------------------------------------------------

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

public class cambiaa24 : MonoBehaviour {




        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "maloren") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (24);




            }
        }
    }

 ------------------------------------------------------------------------------------------------------------------------

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

public class cambiaa25 : MonoBehaviour {




        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "anieve") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (25);




            }
        }
    }



--------------------------------------------------------------------------------------------------------------------------

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

public class cambiaa26 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "muerte26") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (26);




            }
        }
    }

--------------------------------------------------------------------------------------------------------------------------

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

public class cambiaa30impactoexclamacioncubo : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "torreplayer") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (30);




            }
        }
    }

---------------------------------------------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;/// <summary>
public class cambiaa30portiempo : MonoBehaviour {


        public Text contador1;
        public Text fin1;
        private float tiempo = 25f;
        // Use this for initialization
        void Start () {
            contador1.text = " " + tiempo;
            fin1.enabled = false;




        }

        // Update is called once per frame
        void Update ()
        {
            tiempo -= Time.deltaTime;
            contador1.text = " " + tiempo.ToString ("f0");
            if (tiempo <= 0) {
                contador1.text = "0";
                fin1.enabled = true;



                {




                    //Destroy (gameObject, 0.0f); //////original activado

                    {

                        //Application.LoadLevel (1); ESTE ES EL ORIGINALLLLLLL

                        //    Application.LoadLevel (1);
                        Application.LoadLevel (30);

                    }
                }
            }
        }

    }

-----------------------------------------------------------------------------------------------------------------------


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

public class cambiaa31portacimpacto : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "a31") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (31);




            }
        }
    }

----------------------------------------------------------------------------------------------------------------------

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

public class cambiaa33 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "a33") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (33);




            }
        }
    }

--------------------------------------------------------------------------------------------------------------------------

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

public class cambialaescenaa9alapretarespacio : MonoBehaviour {


        void Update ()
        {


            if (Input.GetKey(KeyCode.Space))////funciona contantemente al apretar W mayusculas a de ser
                //if (Input.GetKeyDown(KeyCode.W))// funciona pasito a pasito
       

        Application.LoadLevel (9);



        }
    }


--------------------------------------------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;/// <summary>
public class CAMBIAPORTIEMPOAL28 : MonoBehaviour {


        public Text contador1;
        public Text fin1;
        private float tiempo = 15f;
        // Use this for initialization
        void Start () {
            contador1.text = " " + tiempo;
            fin1.enabled = false;




        }

        // Update is called once per frame
        void Update ()
        {
            tiempo -= Time.deltaTime;
            contador1.text = " " + tiempo.ToString ("f0");
            if (tiempo <= 0) {
                contador1.text = "0";
                fin1.enabled = true;



                {




                    //Destroy (gameObject, 0.0f); //////original activado

                    {

                        //Application.LoadLevel (1); ESTE ES EL ORIGINALLLLLLL

                        //    Application.LoadLevel (1);
                        Application.LoadLevel (28);

                    }
                }
            }
        }

    }

-------------------------------------------------------------------------------------------------------------------------

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;/// <summary>
public class cambiaportirmpoal35 : MonoBehaviour {



        public Text contador1;
        public Text fin1;
        private float tiempo = 70f;
        // Use this for initialization
        void Start () {
            contador1.text = " " + tiempo;
            fin1.enabled = false;




        }

        // Update is called once per frame
        void Update ()
        {
            tiempo -= Time.deltaTime;
            contador1.text = " " + tiempo.ToString ("f0");
            if (tiempo <= 0) {
                contador1.text = "0";
                fin1.enabled = true;



                {




                    //Destroy (gameObject, 0.0f); //////original activado

                    {

                        //Application.LoadLevel (1); ESTE ES EL ORIGINALLLLLLL

                        //    Application.LoadLevel (1);
                        Application.LoadLevel (35);

                    }
                }
            }
        }

    }

--------------------------------------------------------------------------------------------------------------------

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

public class CAMBIO28 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "OTROMALO") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (28);




            }
        }
    }

----------------------------------------------------------------------------------------------------------------------


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

public class CAMBIOA27 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f);


            if (collision.gameObject.tag == "CAPSULAMALO") {
                //Destroy (gameObject, 2.0f);

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (27);




            }
        }
    }
-------------------------------------------------------------------------------------------------------------------


Estos scripts de c# son ejemplos para cambios de escenas por tiempo y cambios de escenas por colisiones con gameobjets con un nombre de tag especifico para crear los cambios......no los e puesto todos es solo para que el que los vea se aga una idea del funcionamiento del videojuego al jugar con los cambios de escenas con el tema ,,,,tiempo y colision,,,,

 En la imagen se ven las treinta y pico escenas que uso en el videojuego.........

En la imagen se ven las treinta y pico escenas que uso en el videojuego.........

El videojuego funciona a la perfeccion en su version de descarga desde itch.io pero en la version de jugar desde la web tiene bugs, ignoro el motivo pero se repite continuamente una escena del videojuego del impacto a un personaje....solo ocurre en la version web, en la de descacarga ningun problema.


De todas formas la version web tambien es jugable pero has de ser muy rapido al acertar los disparos...rapidisimo bamos¡¡¡¡¡¡


El player dispara desde 3 lugares diferentes, tiene 3 objetivos en conjunto .

1-personajes aislados.

2-un ascensor para destrozar.

3- un personaje cargado encima de explosivos que si le das destruyes todo y todo y todo y a todossssss.

En resumen es un videojuego que solo tiene el objetivo de ir explorando lo que se puede disparar y ver que pasa, lo mejor del videojuego es que es completamente fluido,

 el cambio de escenas me salio genial en el sentido que el juego no se relantiza no funciona lento para nada en ningun instante....

y lo podia haber seguido trabajando asta alcanzar alrededor de 1Gb de capacidad, es lo maximo que me dejan para subir un videojuego a internet sin pedir permisos o consultas adicionales desde itch,io  ,,,

 o desde gamejolt......ademas boy a empezar un vidojuego nuevo sobre un minero y una mina...

.quiero jugar con las luces en este nuevo proyecto, y acerlo muy corto, muy concreto, y que sea completo, con principio y fin....no cuento nada que me lo copian.....pero saldra en itch.io ...

.a la venta....un proyecto pensado para las navidades que ya se caen encima nuestro...hare una demo y el proyecto completo lo vendo por 1 dolar...

.si no vende lo pondre gratis con el tiempo...¡¡ja ja ja ja ja ja!!!  es un jovi una aficion la mia..pero que narices lo economico motiva un monton cuando te ponen la miel en los lavios.




Seguire con detalles del videojuego C# scripts del videojuego THE OLYMPIC SNIPER,

este script de devajo cambia de escena al apretar la tecla "espacio" "espace" la mas alargada del teclado...


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

public class cambialaescenaa9alapretarespacio : MonoBehaviour {


        void Update ()
        {


            if (Input.GetKey(KeyCode.Space))////funciona contantemente al apretar W mayusculas a de ser
                //if (Input.GetKeyDown(KeyCode.W))// funciona pasito a pasito
        

        Application.LoadLevel (9);



        }
    }

-------------------------------------------------------------------------------

---------------------------------------------------------------------------


Las de cambio de escena por tiempo, explicare su funcionamiento lo mejor que pueda ....pongo un ejemplo aqui devajo....e imagenes captura de imagenes,,,,,




    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;/// <summary>

public class cambioaescenaanueve : MonoBehaviour {


        public Text contador1;
        public Text fin1;
        private float tiempo = 15f;
        // Use this for initialization
        void Start () {
            contador1.text = " " + tiempo;
            fin1.enabled = false;




        }

        // Update is called once per frame
        void Update ()
        {
            tiempo -= Time.deltaTime;
            contador1.text = " " + tiempo.ToString ("f0");
            if (tiempo <= 0) {
                contador1.text = "0";
                fin1.enabled = true;



                {




                    //Destroy (gameObject, 0.0f); //////original activado

                    {

                        //Application.LoadLevel (1); ESTE ES EL ORIGINALLLLLLL

                    //    Application.LoadLevel (1);
                    Application.LoadLevel (9);

                    }
                }
            }
        }

    }




Hay que poner un canvas y unos textos que se tienen que arrastrar con el mouse en las casillas vacias del escript,,,,,los textos tiene que tener el numero 0.

Si no se hace esto no funciona.



Esto es en el tema por tiempo que cambia la escena.

En el tema de colision por tag, al impactar el proyectil sobre un personaje que tiene un tag concreto, hace que se cambie la escena,,,,en esta imagen captura pongo los diversos escripts con la orden de tag concreto en cada uno de ellos para que aga los cambios de escenas en el videojuego...


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

public class CAMBIO28 : MonoBehaviour {



        void Start () {

        }




        //void OnCollisionEnter (){


        void OnCollisionEnter (Collision collision)
        {
            //if (collision.gameObject.tag == "maloazul (4)") {
            //Destroy (gameObject, 0.0f); 


            if (collision.gameObject.tag == "OTROMALO") {
                //Destroy (gameObject, 2.0f); 

                //    transform.position = new Vector3 (198.301f, 20.316f, 136.023f);/////////nuebo mio
                //transform.Translate (new Vector3 (198 * Time.deltaTime, 20, 136.2f), Space.Self);/////////////IMBENTADO

                //Application.LoadLevel (1);////ORIGINALLLLLLLLLLLL
                Application.LoadLevel (28);




            }
        }
    }




El personaje se llama "malopasea1" pero le puesto un tag con el nombre "OTROMALO"    el cual es el que esta escrito en el script y hace la funcion del cambio de la escena,,,,es un pelin complicado a lo primero de entender,,,,,hay que hacer muchos juegos y repetirse para ir comprendiendolo.....pero cuando se consigue armonizar el tema quedan las ideas geniales , me refiero los cambios que se pueden conseguir durante el juego.https://gamejolt.com/games/farncotrador_olimpico-3/654733