Boss Level vorerst fertig zum testen (Animationen für Königin/Josh fehlen noch)
This commit is contained in:
8
Assets/AssetsFORELLE/Script/BossLevel.meta
generated
Normal file
8
Assets/AssetsFORELLE/Script/BossLevel.meta
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d757af3b742a9a1498eef5e57f7ccef2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/AssetsFORELLE/Script/BossLevel/Amboss.cs
Normal file
33
Assets/AssetsFORELLE/Script/BossLevel/Amboss.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Amboss : MonoBehaviour
|
||||
{
|
||||
private GameObject anvil;
|
||||
public bool one;
|
||||
public bool two;
|
||||
public bool three;
|
||||
public bool four;
|
||||
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
anvil = GameObject.Find("ambos");
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void FixedUpdate()
|
||||
{
|
||||
|
||||
if(one&&two&&three&&four)
|
||||
{
|
||||
anvil.GetComponent<Rigidbody2D>().constraints = RigidbodyConstraints2D.None;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel/Amboss.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel/Amboss.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2295a2c765238bc4cb91c35b0ec7d6a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
44
Assets/AssetsFORELLE/Script/BossLevel/Bang.cs
Normal file
44
Assets/AssetsFORELLE/Script/BossLevel/Bang.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Bang : MonoBehaviour
|
||||
{
|
||||
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public IEnumerator Banger(GameObject projectilePrefab,Transform t ,Transform dim, Vector2 shotSpeed, float colliderDisabledSeconds, float shotAliveSeconds)
|
||||
{
|
||||
|
||||
|
||||
// create projectile
|
||||
GameObject projectile = Instantiate(projectilePrefab,
|
||||
t.position,
|
||||
t.rotation);
|
||||
projectile.transform.SetParent(dim);
|
||||
|
||||
// add force to projectile
|
||||
projectile.GetComponent<Rigidbody2D>().velocity = shotSpeed;
|
||||
|
||||
// wait until enabling collider
|
||||
yield return new WaitForSeconds(colliderDisabledSeconds);
|
||||
projectile.GetComponent<Collider2D>().enabled = true;
|
||||
|
||||
// wait given time before destroying
|
||||
yield return new WaitForSeconds(shotAliveSeconds);
|
||||
|
||||
Destroy(projectile);
|
||||
|
||||
}
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel/Bang.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel/Bang.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a05e7449f649e843b5439906379b81c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -6,6 +6,7 @@ public class BossLevel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject thepoint;
|
||||
[SerializeField] private Transform[] respawnPoints;
|
||||
[SerializeField] private EdgeCollider2D[] Platforms;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
28
Assets/AssetsFORELLE/Script/BossLevel/DynamicRespawn.cs
Normal file
28
Assets/AssetsFORELLE/Script/BossLevel/DynamicRespawn.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DynamicRespawn : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Transform respawn;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col)
|
||||
{
|
||||
if(CompareTag("Player"))
|
||||
{
|
||||
respawn.transform.SetPositionAndRotation(gameObject.transform.position ,Quaternion.identity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel/DynamicRespawn.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel/DynamicRespawn.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d246e9ee618d841439a0c6ac305009a9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
52
Assets/AssetsFORELLE/Script/BossLevel/KitchenGunBossMod.cs
Normal file
52
Assets/AssetsFORELLE/Script/BossLevel/KitchenGunBossMod.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
|
||||
/*
|
||||
WICHTIG
|
||||
Für dieses Script muss ein Object namens "RespawnProjectile" vorhanden sein an dem man wieder spawnt
|
||||
Collider Disabled Seconds muss so gesetzt werden das das Projectil aus der Quelle rauskommt ohne zerstört zu werden
|
||||
*/
|
||||
|
||||
public class KitchenGunBossMod : MonoBehaviour
|
||||
{
|
||||
|
||||
private Bang bullet;
|
||||
private IEnumerator coroutine;
|
||||
// The shot projectiles
|
||||
public GameObject projectilePrefab;
|
||||
// Time between shots, game needs to be restarted to take effect
|
||||
public float shotIntervalSeconds = 1f;
|
||||
// Time alive for the projectiles or until they hit something
|
||||
public float shotAliveSeconds = 1f;
|
||||
// Time until collider gets enabled
|
||||
public float colliderDisabledSeconds = .2f;
|
||||
// Speed of projectiles
|
||||
public Vector2 shotSpeed = new Vector2(1f, 0f);
|
||||
// Smallest step size for shot speed
|
||||
private short shotSpeedStepSize = 50;
|
||||
[SerializeField] private bool dim1;
|
||||
private Transform dim;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
if(dim1){dim=GameObject.Find("Dim1").transform;} else {dim=GameObject.Find("Dim2").transform;}
|
||||
bullet = GameObject.Find("DimAll").GetComponent<Bang>();
|
||||
InvokeRepeating("RecurringBang",0f,shotIntervalSeconds);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RecurringBang()
|
||||
{
|
||||
coroutine = bullet.Banger(projectilePrefab, transform, dim, shotSpeed, colliderDisabledSeconds, shotAliveSeconds);
|
||||
StartCoroutine(coroutine);
|
||||
}
|
||||
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel/KitchenGunBossMod.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel/KitchenGunBossMod.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 77d745175c8c7064ea90f3991f53f0e1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,58 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlayerPressurePlateBossMod: MonoBehaviour
|
||||
{
|
||||
|
||||
public SpriteRenderer spriteRenderer;
|
||||
public Sprite originalSprite;
|
||||
public Sprite activatedSprite;
|
||||
public GameObject[] doors;
|
||||
private Amboss script;
|
||||
[SerializeField] int num;
|
||||
private Transform thepoint;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
script = GameObject.Find("DimAll").GetComponent<Amboss>();
|
||||
thepoint = GameObject.Find("RespawnProjectile").transform;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other) {
|
||||
spriteRenderer.sprite = activatedSprite;
|
||||
|
||||
foreach (var door in doors)
|
||||
{
|
||||
door.SetActive(false);
|
||||
}
|
||||
|
||||
thepoint.transform.SetPositionAndRotation(gameObject.transform.position + new Vector3(0,1,0),Quaternion.identity);
|
||||
|
||||
switch (num)
|
||||
{
|
||||
case 1: script.one = true;
|
||||
break;
|
||||
case 2: script.two = true;
|
||||
break;
|
||||
case 3: script.three = true;
|
||||
break;
|
||||
case 4: script.four = true;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
Destroy(gameObject.GetComponent<EdgeCollider2D>());
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
11
Assets/AssetsFORELLE/Script/BossLevel/PlayerPressurePlateBossMod.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/BossLevel/PlayerPressurePlateBossMod.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d3dc8c732803034082446db81dea51a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user