AVANCE 3
UPGRADE SYSTEM » Devlog
En esta semana comencé a trabajar en la clase base "Arma". De igual forma le agregue tipos de disparo para que me ayudaran a darle otro toque y que no todo se quedara en los stats.
using System.Collections;
using UnityEngine;
public abstract class Arma
{
protected int BulletDamage;
protected int bullets;
protected int PlayerSpeed;
protected float shootDelay = 0.2f;
protected ShootType currentShootType = ShootType.Single;
public Arma() { }
//hacer funcion booleana de shoot public
public virtual void Shoot()
{
bullets--;
}
public ShootType GetcurrentShootType()
{
return currentShootType;
}
public int GetBulletDamage()
{
return BulletDamage;
}
public float GetshootDelay()
{
return shootDelay;
}
public int Getbullets()
{
return bullets;
}
public int GetPlayerSpeed()
{
return PlayerSpeed;
}
//set
public void SetBulletDamage(int _BulletDamage)
{
BulletDamage = _BulletDamage;
}
public void SetBullets(int _bullets)
{
bullets = _bullets;
}
public void SetPlayerSpeed(int _PlayerSpeed)
{
PlayerSpeed = _PlayerSpeed;
}
public void SetshootDelay(float _shootDelay)
{
shootDelay = _shootDelay;
}
public ShootType SetcurrentShootType()
{
return currentShootType;
}
}
public enum ShootType
{
Single,
Burst,
Auto
}
De igual forma en los scripts de cada arma que tenían esta estructura.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Arma;
public class PistolaNormie : Arma
{
public Arma arma;
public void Start()
{
PlayerSpeed = 10;
BulletDamage = 10;
bullets = 10;
shootDelay = 0.3f;
currentShootType = ShootType.Single;
}
}
Esta semana estuve trabjando en esto.
UPGRADE SYSTEM
| Status | In development |
| Author | lissethmte |
| Genre | Shooter |
Leave a comment
Log in with itch.io to leave a comment.