Boss Level Layout done (Its not perfect i know)
This commit is contained in:
22
Assets/AssetsFORELLE/Script/BossLevel.cs
Normal file
22
Assets/AssetsFORELLE/Script/BossLevel.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class BossLevel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject thepoint;
|
||||
[SerializeField] private Transform[] respawnPoints;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
thepoint = GameObject.Find("RespawnProjectile");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31badcea47741d341b73273a4cb0b07e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -23,11 +23,14 @@ public class KitchenGun : MonoBehaviour
|
||||
public Vector2 shotSpeed = new Vector2(1f, 0f);
|
||||
// Smallest step size for shot speed
|
||||
private short shotSpeedStepSize = 50;
|
||||
[SerializeField] private bool dim1;
|
||||
private string dim;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
InvokeRepeating("RecurringBang",0f,shotIntervalSeconds);
|
||||
if(dim1){dim="Dim1";} else {dim="Dim2";}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -50,7 +53,7 @@ public class KitchenGun : MonoBehaviour
|
||||
GameObject projectile = Instantiate(projectilePrefab,
|
||||
position,
|
||||
t.rotation);
|
||||
projectile.transform.parent = GameObject.Find("Dim2").transform;
|
||||
projectile.transform.parent = GameObject.Find(dim).transform;
|
||||
|
||||
// add force to projectile
|
||||
projectile.GetComponent<Rigidbody2D>().velocity = shotSpeed;
|
||||
|
Reference in New Issue
Block a user