Devlog 6




We'll upload new gameplay, sound, art as soon as posible

This is the script for some jumpscare :

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

public class palasicJmpScr : MonoBehaviour {
    charMoving move;
    public Camera mainCamera;
    public Camera palasicJmp;
    bool changeCamera = false;
    [SerializeField]private float waktu;
    [SerializeField]private float delayScr;
    public GameObject palasic;
    public BoxCollider2D palasicScr;

    void Start()
    {
        move = FindObjectOfType<charMoving>();
        palasic.SetActive(false);
        palasicJmp.enabled = false;
    }

    void Update()
    {
        if (changeCamera)
        {
            move.speed = 0;
            mainCamera.enabled = false;
            palasicJmp.enabled = true;
            palasicScr.enabled = false;
            StartCoroutine(delayWaktu());
            StartCoroutine(delayJmpScr());
        }
        else if (!changeCamera)
        {
            move.speed = 2.5f;
            mainCamera.enabled = true;
            palasicJmp.enabled = false;
        }
    }

    IEnumerator delayWaktu()
    {
        if (waktu > 0)
        {
            waktu -= Time.deltaTime;
            yield return 0;
        }else {
            palasicScr.enabled = true;
            palasic.SetActive(true);
            Destroy(palasic);
            //waktu = 3;
        }
    }

    IEnumerator delayJmpScr()
    {
        if (delayScr > 0)
        {
            delayScr -= Time.deltaTime;
            yield return 0;
        }
        else
        {
            palasic.SetActive(true);
        }
    }

    void OnMouseDown()
    {
        changeCamera = !changeCamera;
    }
}

Files

Prototype1.rar 28 MB
Oct 30, 2017

Get Palasic

Leave a comment

Log in with itch.io to leave a comment.