miércoles, 23 de agosto de 2023

jueves, 17 de agosto de 2023

scripts en C# Unity de barra de vida ganar vida y barra de vida perder vida;

 

 

 



https://www.youtube.com/watch?v=JbFlzZAQxZA&t=2s

 using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class datosjugador : MonoBehaviour
{
    public int vidaPlayer = 1000;//INBENTO PONER 1000
    public Slider vidaVisual;
        private void Update()

        {

        vidaVisual.GetComponent<Slider>().value = vidaPlayer;//INBENTO =1000;

      //  if (vidaPlayer <= 1000)// IMBENTO 1000 EL ORIGINAL 0--estaba asi
            if (vidaPlayer <=1)// IMBENTO 1000 EL ORIGINAL 0
        {

            Debug.Log("game over");


            Application.LoadLevel(1);//imbento




        }
}
}

 

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

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


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

public class boladamage : MonoBehaviour
{


    public int vidaPlayer = 1000;//IMBENTO TODA LA LINEA

    //  public int boti;//imbento
    public int damage;
    public GameObject Player;
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "bobo")//original
           // if (other.tag == "yoyo")
            {

            Player.GetComponent<datosjugador>().vidaPlayer -= damage;


        }
     //   if (other.tag == "yoyo")//imbento yo
        {

           // Player.GetComponent<datosjugador>().vidaPlayer += boti;//imbento
          //  Player.GetComponent<datosjugador>().vidaPlayer += damage;//imbento

            //  Debug.Log("estoenemigo");//original
        }
    }
}

 

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

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

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

public class boladavida : MonoBehaviour
{



    public int vidaPlayer = 1000;//IMBENTO TODA LA LINEA

    //  public int boti;//imbento
  //  public int damage = 50;//ORIGINAL
    public int damage = 1000;//IMBENTO

    public GameObject Player;
    private void OnTriggerEnter(Collider other)
    {
      //  if (other.tag == "yoyo")//original
          //  if (other.tag == "tutu")//imbento
                                      if (other.tag == "bobo")//deveria ser el correcto por que es el tag del player bobo el que toca
            {

           // Player.GetComponent<datosjugador>().vidaPlayer += damage;//ORIGINAL
            Player.GetComponent<datosjugador>().vidaPlayer = damage;//IMBENTO

        }
        //   if (other.tag == "yoyo")//imbento yo
        {

            // Player.GetComponent<datosjugador>().vidaPlayer += boti;//imbento
            //  Player.GetComponent<datosjugador>().vidaPlayer += damage;//imbento

            //  Debug.Log("estoenemigo");//original
        }
    }
}

 

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

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

viernes, 11 de agosto de 2023

¡¡Viva itch.io!!;

Hace unos meses cometi un error publicando en itch,io, me entusiasme demasiado con mis trabajos y me puse a lo loco apublicar asta la mas minima mejoria de los juegos que ago, y me llamaron la atencion desde itch,io,
la verdad tienen razon y ahora soy mucho mas cuidadoso.........e aqui la advertencia de  itch,io que ahora cumplo al pie de la letra....... 
 
 
 Hola, Puede publicar contenido pago y su cuenta no está restringida para hacerlo; sin embargo, cargar shovelware, reskins o contenido con poco o ningún cambio con respecto a las cargas anteriores se considera spam y no está permitido según nuestras pautas. Descubrimos que su otra cuenta infringe esa directriz y, como tal, ese contenido ya no se mostrará en las búsquedas. Absténgase de cargar cantidades masivas de contenido de baja calidad para aumentar su visibilidad o intentar que la gente compre algo. Hacer lo mismo en esta nueva cuenta dará como resultado que se tomen las mismas medidas en su contra. Gracias