Beispiel #1
0
 public void OnBackGroundCollision(GameObject projectile, MovementCheck movementCheck)
 {
     Debug.Log("STICKY!!!");
     projectile.transform.parent.GetComponent <ProjectileMovement>().rotateNow  = false;
     projectile.GetComponent <ProjectileCollision> ().collideWithBack           = false;
     projectile.transform.parent.GetComponent <ProjectileMovement> ().tempSpeed = 0;
 }
 void Awake()
 {
     movementCheck = GetComponentInChildren <MovementCheck>();
     myJump        = GetComponentInChildren <EnemyJump>();
     collisionMask = LayerMask.GetMask("Ground");
     calculateRays();
 }
Beispiel #3
0
    public void OnBackGroundCollision(GameObject projectile, MovementCheck movementCheck)
    {
        projectile.transform.parent.GetComponent <ProjectileMovement>().rotateNow = false;
        Vector2 dir = Vector2.Reflect(projectile.transform.parent.position, movementCheck.hit2d.normal);

        projectile.transform.parent.eulerAngles = new Vector3(0, 0, Mathf.Atan2(dir.x, dir.y) * Mathf.Rad2Deg);
    }
 public void breakWall()
 {
     hp--;
     if (hp <= 0 && canBreak)
     {
         canBreak = false;
         MovementCheck move = GameObject.FindWithTag("Player").GetComponentInChildren <MovementCheck>();
         move.destroyBlock(transform);
         Destroy(gameObject);
     }
 }
	private void Update()
	{
		if (!Input.GetMouseButtonDown(0)) return;
		
		var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
		RaycastHit hit;
		if (!Physics.Raycast(ray, out hit)) return;
		print(hit.point);
		if (!MovementCheck.CheckedTiles[Mathf.RoundToInt(hit.point.x), Mathf.RoundToInt(hit.point.y)])return;

		transform.position = new Vector3(Mathf.RoundToInt(hit.point.x), Mathf.RoundToInt(hit.point.y), transform.position.z);
		MovementCheck.Check(_gridGenerator.GridDataArray, _playerMovementValue, transform.position);
	}
Beispiel #6
0
        void HandlePlayerMove(Player p, Position next, byte rotX, byte rotY)
        {
            if (!Game.RoundInProgress || p.level != Game.Map)
            {
                return;
            }

            bool reverted = MovementCheck.DetectNoclip(p, next) ||
                            MovementCheck.DetectSpeedhack(p, next, ZSConfig.MaxMoveDistance);

            if (reverted)
            {
                p.cancelmove = true;
            }
        }
    void Awake()
    {
        myStats          = GetComponent <PlayerStats>();
        anim             = GetComponent <Animator>();
        r                = GetComponent <SpriteRenderer>();
        jumpCheck        = GetComponentInChildren <JumpCheck>();
        weaponSprite     = GetComponentInChildren <WeaponSpriteController>();
        grapple          = GetComponentInChildren <Grapple>();
        slopeCheckBottom = GetComponentInChildren <SlopeCheckBottom>();
        slopeCheckTop    = GetComponentInChildren <SlopeCheckTop>();
        movementCheck    = GetComponentInChildren <MovementCheck>();

        collisionMask = LayerMask.GetMask("Ground");

        calculateRays();
        updateRaycastOrigins();
    }
Beispiel #8
0
 void Awake()
 {
     movementCheck = this.GetComponent <MovementCheck> ();
 }
Beispiel #9
0
 void Awake()
 {
     player        = GameObject.FindGameObjectWithTag("Player");
     movementCheck = GetComponentInChildren <MovementCheck>();
     movement      = GetComponent <BasicEnemyMovement>();
 }
Beispiel #10
0
 void Awake()
 {
     temp     = GetComponent <MovementCheck>();
     movement = GetComponentInParent <BasicEnemyMovement>();
 }
	private void Start () {
		MovementCheck.Check(_gridGenerator.GridDataArray, _playerMovementValue, transform.position);
	}
Beispiel #12
0
 public void OnBackGroundCollision(GameObject projectile, MovementCheck movementCheck)
 {
 }
Beispiel #13
0
 public void OnBackGroundCollision(GameObject projectile, MovementCheck movementCheck)
 {
     projectile.SetActive(false);
 }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     mc         = this.GetComponent <MovementCheck> ();
     reflection = transform.GetChild(0).GetComponent <Reflection> ();
 }