Boss Level vorerst fertig zum testen (Animationen für Königin/Josh fehlen noch)

This commit is contained in:
GungHolo 2023-06-22 16:08:30 +02:00
parent 31185531d0
commit 279e8976af
18 changed files with 1886 additions and 435 deletions

View File

@ -12,6 +12,7 @@ GameObject:
- component: {fileID: 5008637316406135653}
- component: {fileID: 5008637316406135659}
- component: {fileID: 5008637316406135658}
- component: {fileID: 8370241272374560545}
m_Layer: 0
m_Name: AudioController
m_TagString: Untagged
@ -178,3 +179,11 @@ AudioLowPassFilter:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!81 &8370241272374560545
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5008637316406135655}
m_Enabled: 1

View File

@ -16,13 +16,10 @@ GameObject:
- component: {fileID: 2410396854066836737}
- component: {fileID: 8881035903807538774}
- component: {fileID: 2410396854066836736}
- component: {fileID: 7766790369216727835}
- component: {fileID: 2410396854066836739}
- component: {fileID: 7917930601971724287}
- component: {fileID: 8316039429838813759}
- component: {fileID: 5185316313602682252}
- component: {fileID: 7290952889933214358}
- component: {fileID: 121913343521417838}
m_Layer: 0
m_Name: Frank
m_TagString: Player
@ -200,21 +197,6 @@ CapsuleCollider2D:
m_Offset: {x: -0.15, y: 0}
m_Size: {x: 1.64, y: 2.91}
m_Direction: 1
--- !u!114 &7766790369216727835
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2410396854066836738}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e4ea2b46765b2a94c81f15618d3ea519, type: 3}
m_Name:
m_EditorClassIdentifier:
_LevelManager1: {fileID: 0}
isFalling: 0
counter: 0
--- !u!114 &2410396854066836739
MonoBehaviour:
m_ObjectHideFlags: 0
@ -227,18 +209,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4760965f3d035f84db6a6741d746428c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &7917930601971724287
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2410396854066836738}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5c8672c5b58eae84da6091aa48615de7, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8316039429838813759
MonoBehaviour:
m_ObjectHideFlags: 0
@ -277,18 +247,5 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e4ea2b46765b2a94c81f15618d3ea519, type: 3}
m_Name:
m_EditorClassIdentifier:
_LevelManager1: {fileID: 2410396854066836738}
isFalling: 0
counter: 0
--- !u!114 &121913343521417838
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2410396854066836738}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a821d8b41cb035c44a9a7c0b05ede9c4, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d757af3b742a9a1498eef5e57f7ccef2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View 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;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2295a2c765238bc4cb91c35b0ec7d6a5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a05e7449f649e843b5439906379b81c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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

View 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);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d246e9ee618d841439a0c6ac305009a9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 77d745175c8c7064ea90f3991f53f0e1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -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>());
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9d3dc8c732803034082446db81dea51a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff