domingo, 2 de mayo de 2021

¿Como e echo este videojuego inspirado en las antiguas maquinas de los salones de videojuegos de los años 80?;

 
¿Como e echo este videojuego inspirado en las antiguas maquinas de los salones de videojuegos de los años 80?

De vez en cuando me gusta recordar los videojuegos de aquellos años, las salas de maquinas le soliamos llamar si no recuerdo mal,
a llovido un monton, y ahora queria repasar algunos juegos de la epoca mirandolos en mi pc y probandolos pero mi configuracion actual del windows10 no me permite jugarlos.
Me boy a limitar a explicar como hice esta pequeña muestra que podeis probar desde el pc desde la web sin istalar nada o descargarlo si se prefiere.

Este videojuego no es idea mia , esta basado en uno que eran una serie de espirales con un nucleo desde el que salian prollectiles y el player tenia que sortearlos , la trampa creo recordar era que cuando se hacia el hueco para tu poder lanzar el prollectil propio al interior de  ese hueco ,el nucleo, ya lanzaba un prollectil que te atacaba a ti, tenias que ser muy rapido para colocarte en ese hueco y disparar tu primero para alcanzar el nucleo, el videojuego original estaba perfectamente equilibrado en su jugavilidad, el mio no tanto , claro que lo e echo bastante rapido, en horas muertas en 1 o 2 semanas,,,,,,
Pero en fin no me entretengo mas, paso a explicar como lo hice con unity,
El juego parece echo en 2dimensiones pero lo e echo en 3 porque siempre los ago en 3 y no savia hacerlo en 2, asi que simule estar echo en 2 dimensiones.

1—tenia que hacer los aros que fuesen girando unos dentro de los otros y un nucleo en su interior


2---tenia que hacer una nave (player) que hiciese disparos y lanzase un chorro de propulsion simulando un coehete.
3—tenia que hacer una poca de defensa de esos aros produciendo disparos que  destruyen ala nave (player).
4—tenia que hacer una pantalla con el titulo ¡¡game over!! al perder el videojuego, y que alos pocos segundos reiniciase la partida.
5—tenia que producir las explosiones del nucleo y buscar sonidos que entonasen con la tematica.

1------------
Para hacer los aros utilize blender,lo hice desde agregar y agregando un circulo que luego extrusione.
erramientas---modo edicion------y estirar agrandar---sale un aro plano al que luego le borro4 partes para hacer los huecos.
El mismo aro lo copio y lo pego en unity varias veces para hacer los interiores y coloco los scripts que producen sus giros sobre si mismos.
Desde blender estos aros los exporto en formato fbx.
Y en unity los manipulo agregandoles unos box colider para impedir que mis valas atravisen el interior del nucleo , solo pueden pasar por el hueco.
El fondo negro que simula el espacio es un cubo con la gravedad estatica, y los aros todos tienen la gravedad puesta caen en cima de ese cubo que simula el espacio universo negro.
Mi nave en realidad no buela corre por el suelo como si fuese un videojuego de coches y cuando golpea uno de los aros el videojuego camboia a la pantalla ¡¡game over¡¡, durante unos segundos y regresa ala pantalla o nivel original y comienza denuebo el videojuego, asi asta pillarle eltuquillo y conseguir alcanzar el nucleo con disparos y ganar el videojuego….

Bueno ahora lo mejor de esta pequeña redaccion sobre este videojuego esque lo voy a colgar en MEGA  para el que quiera descargarselo y estudiarselo o practicar con el, pueda hacerlo , son los archivos con los assets  los scripts los graficos y todo lo necesario para que veais a la perfeccion como esta contruido,  bamos que soy un acha cuando quiero para la gente que save un poco menos que yo…...hos pongo varios enlaces importantes tambien.


DESCARGATE DESDE MEGA EL EJEMPLO PARA ESTUDIARLO


 

https://opengameart.org/ 







sábado, 1 de mayo de 2021

TRIBUTE TO A VIDEO GAME OF RECREATIONAL MACHINES FROM THE 80'S

 

😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃😃

 Mi nuevo videojuego “ATAKEAEREO”

 😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁

 HOMENAJE A UN VIDEOJUEGO DE MAQUINAS RECREATIVAS DE LOS AÑOS 80 DESTRULLE EL NUCLEO W-A-S-D- MOUSE BOTON IZQUIERDO
TRIBUTE TO A VIDEO GAME OF RECREATIONAL MACHINES FROM THE 80'S DESTROY THE CORE W-A-S-D- MOUSE BUTTON LEFT 


 

viernes, 23 de abril de 2021

jueves, 22 de abril de 2021

THE END warlike feats , UNITY

 

THE END

warlike feats


Doy por finalizado el videojuego, no puedo mas, quiero hacer otros videojuegos este lo e retocado asta donde mi paciencia a llegado, pero me siento saturado, de todas formas el videojuego tiene un principio y un final con pantalla de éxito o victoria de haber superado los 3 niveles sencillos que tiene.

SIMPLEMENTE ACUMULA VIDAS Y ACUMULA CAPSULAS PARA SUMAR PUNTOS Y ACUMULA ÍTEMS Y EL VIDEOJUEGO LO GANAS CON FACILIDAD.

martes, 20 de abril de 2021

Unity ajustes de efecto disparos.

Unity ajustes de efecto disparos.



Resumiendo lo principal del video tutorial es tener en cuenta que la linea que hace de mirilla para apuntar es un duplicado del gameobject un cubo que tiene el script del mouse que sirve para apuntar balanceando el arma, este es hijo la mirilla es hijo del gameobject que contiene ese script y luego el arma también esta puesto de hijo del cubo gameobject que contiene el script del mouse para balancear el arma y apuntar….

Mas fácil pongo un grafico general del player.



Como un árbol del que salen las ramas, el player seria el tronco, de donde parten los disparos seria una rama del tronco, y de esa rama saldrían otras dos ramas la mirilla que señala las trayectorias de los disparos y el arma ametralladora o rifle.














player…………...gameobject desde donde parten los disparos fogonazos………..gameobject que marca las trayectorias de los disparos mirilla y también el arma……



using System;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace UnityStandardAssets.Utility
{
public class SimpleMouseRotator : MonoBehaviour
{
// A mouselook behaviour with constraints which operate relative to
// this gameobject's initial rotation.
// Only rotates around local X and Y.
// Works in local coordinates, so if this object is parented
// to another moving gameobject, its local constraints will
// operate correctly
// (Think: looking out the side window of a car, or a gun turret
// on a moving spaceship with a limited angular range)
// to have no constraints on an axis, set the rotationRange to 360 or greater.
public Vector2 rotationRange = new Vector3(70, 70);
public float rotationSpeed = 10;
public float dampingTime = 0.2f;
public bool autoZeroVerticalOnMobile = true;
public bool autoZeroHorizontalOnMobile = false;
public bool relative = true;


private Vector3 m_TargetAngles;
private Vector3 m_FollowAngles;
private Vector3 m_FollowVelocity;
private Quaternion m_OriginalRotation;


private void Start()
{
m_OriginalRotation = transform.localRotation;
}


private void Update()
{
// we make initial calculations from the original local rotation
transform.localRotation = m_OriginalRotation;

// read input from mouse or mobile controls
float inputH;
float inputV;
if (relative)
{
inputH = CrossPlatformInputManager.GetAxis("Mouse X");
inputV = CrossPlatformInputManager.GetAxis("Mouse Y");

// wrap values to avoid springing quickly the wrong way from positive to negative
if (m_TargetAngles.y > 180)
{
m_TargetAngles.y -= 360;
m_FollowAngles.y -= 360;
}
if (m_TargetAngles.x > 180)
{
m_TargetAngles.x -= 360;
m_FollowAngles.x -= 360;
}
if (m_TargetAngles.y < -180)
{
m_TargetAngles.y += 360;
m_FollowAngles.y += 360;
}
if (m_TargetAngles.x < -180)
{
m_TargetAngles.x += 360;
m_FollowAngles.x += 360;
}

#if MOBILE_INPUT
// on mobile, sometimes we want input mapped directly to tilt value,
// so it springs back automatically when the look input is released.
if (autoZeroHorizontalOnMobile) {
m_TargetAngles.y = Mathf.Lerp (-rotationRange.y * 0.5f, rotationRange.y * 0.5f, inputH * .5f + .5f);
} else {
m_TargetAngles.y += inputH * rotationSpeed;
}
if (autoZeroVerticalOnMobile) {
m_TargetAngles.x = Mathf.Lerp (-rotationRange.x * 0.5f, rotationRange.x * 0.5f, inputV * .5f + .5f);
} else {
m_TargetAngles.x += inputV * rotationSpeed;
}
#else
// with mouse input, we have direct control with no springback required.
m_TargetAngles.y += inputH*rotationSpeed;
m_TargetAngles.x += inputV*rotationSpeed;
#endif

// clamp values to allowed range
m_TargetAngles.y = Mathf.Clamp(m_TargetAngles.y, -rotationRange.y*0.5f, rotationRange.y*0.5f);
m_TargetAngles.x = Mathf.Clamp(m_TargetAngles.x, -rotationRange.x*0.5f, rotationRange.x*0.5f);
}
else
{
inputH = Input.mousePosition.x;
inputV = Input.mousePosition.y;

// set values to allowed range
m_TargetAngles.y = Mathf.Lerp(-rotationRange.y*0.5f, rotationRange.y*0.5f, inputH/Screen.width);
m_TargetAngles.x = Mathf.Lerp(-rotationRange.x*0.5f, rotationRange.x*0.5f, inputV/Screen.height);
}

// smoothly interpolate current values to target angles
m_FollowAngles = Vector3.SmoothDamp(m_FollowAngles, m_TargetAngles, ref m_FollowVelocity, dampingTime);

// update the actual gameobject's rotation
transform.localRotation = m_OriginalRotation*Quaternion.Euler(-m_FollowAngles.x, m_FollowAngles.y, 0);
}
}
}

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

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

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

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

public class launchermasvelocidad : MonoBehaviour {


public Rigidbody projectile;
public Rigidbody explosiveProjectile;
public float launchspeed = 50;
public bool useExplodingProjectiles = false;

private float _LaunchDelayTime = 0.0f;

public int stackSize = 60;
public Transform launchHole1;
public Transform launchHole2;

private Stack _Projectiles;
private Stack _ExplosiveProjectiles;
private Transform _myTransform;

// Use this for initialization
void Start ()
{
_myTransform = transform;
_Projectiles = new Stack();
if(useExplodingProjectiles)
{
_ExplosiveProjectiles = new Stack();
}

for(int i = 0; i < stackSize; i++)
{
Rigidbody tr = Instantiate (projectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
PushProjectile(tr);

if(useExplodingProjectiles)
{
Rigidbody rr = Instantiate (explosiveProjectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
PushExplosiveProjectile(rr);
}
}
}

// Update is called once per frame
void Update ()
{
if(_Projectiles.Count > 0)
{
if(Time.time > _LaunchDelayTime)
{




if (Input.GetButton ("Fire1")) ////ametralladora
// if (Input.GetButtonDown ("Fire1")) original tiro a tiro

{
Rigidbody tr = PopProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole1.position;
tr.transform.rotation = launchHole1.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

tr = PopProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole2.position;
tr.transform.rotation = launchHole2.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

_LaunchDelayTime = Time.time + 0.1f;
}
}
}

if(useExplodingProjectiles)
{
if(_ExplosiveProjectiles.Count > 0)
{
if(Time.time > _LaunchDelayTime)
{
if (Input.GetButtonDown ("Fire2"))
{
Rigidbody tr = PopExplosiveProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole1.position;
tr.transform.rotation = launchHole1.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

tr = PopExplosiveProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole2.position;
tr.transform.rotation = launchHole2.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

_LaunchDelayTime = Time.time + 0.5f;
}
}
}
}
}

public void PushProjectile(Rigidbody x)
{
x.gameObject.SetActive(false);
_Projectiles.Push(x);
}

public Rigidbody PopProjectile()
{
return (Rigidbody)_Projectiles.Pop();
}

public void PushExplosiveProjectile(Rigidbody x)
{
x.gameObject.SetActive(false);
_ExplosiveProjectiles.Push(x);
}

public Rigidbody PopExplosiveProjectile()
{
return (Rigidbody)_ExplosiveProjectiles.Pop();
}
}

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

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

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

/// <summary>
/// Launcher.
///
/// 3/2/2013
/// Steve Peters
/// Game Developers Guild - Miami, FL
///
/// Allows us to launch projectiles at a wall. It preinstantiates and stores the projectiles in a
/// stack to improve performance
/// </summary>
using UnityEngine;
using System.Collections;

public class Launcher : MonoBehaviour
{

public Rigidbody projectile;
public Rigidbody explosiveProjectile;
public float launchspeed = 50;
public bool useExplodingProjectiles = false;

private float _LaunchDelayTime = 0.0f;

public int stackSize = 60;
public Transform launchHole1;
public Transform launchHole2;

private Stack _Projectiles;
private Stack _ExplosiveProjectiles;
private Transform _myTransform;

// Use this for initialization
void Start ()
{
_myTransform = transform;
_Projectiles = new Stack();
if(useExplodingProjectiles)
{
_ExplosiveProjectiles = new Stack();
}

for(int i = 0; i < stackSize; i++)
{
Rigidbody tr = Instantiate (projectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
PushProjectile(tr);

if(useExplodingProjectiles)
{
Rigidbody rr = Instantiate (explosiveProjectile, _myTransform.position, _myTransform.rotation) as Rigidbody;
PushExplosiveProjectile(rr);
}
}
}

// Update is called once per frame
void Update ()
{
if(_Projectiles.Count > 0)
{
if(Time.time > _LaunchDelayTime)
{




if (Input.GetButton ("Fire1")) ////ametralladora
// if (Input.GetButtonDown ("Fire1")) original tiro a tiro

{
Rigidbody tr = PopProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole1.position;
tr.transform.rotation = launchHole1.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

tr = PopProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole2.position;
tr.transform.rotation = launchHole2.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

_LaunchDelayTime = Time.time + 0.5f;
}
}
}

if(useExplodingProjectiles)
{
if(_ExplosiveProjectiles.Count > 0)
{
if(Time.time > _LaunchDelayTime)
{
if (Input.GetButtonDown ("Fire2"))
{
Rigidbody tr = PopExplosiveProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole1.position;
tr.transform.rotation = launchHole1.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

tr = PopExplosiveProjectile();
tr.gameObject.SetActive(true);
tr.transform.position = launchHole2.position;
tr.transform.rotation = launchHole2.rotation;
tr.velocity = transform.TransformDirection (Vector3.forward * launchspeed);

_LaunchDelayTime = Time.time + 0.5f;
}
}
}
}
}

public void PushProjectile(Rigidbody x)
{
x.gameObject.SetActive(false);
_Projectiles.Push(x);
}

public Rigidbody PopProjectile()
{
return (Rigidbody)_Projectiles.Pop();
}

public void PushExplosiveProjectile(Rigidbody x)
{
x.gameObject.SetActive(false);
_ExplosiveProjectiles.Push(x);
}

public Rigidbody PopExplosiveProjectile()
{
return (Rigidbody)_ExplosiveProjectiles.Pop();
}
}