Änderungen am 14.03.2025 in der Schuel getroffen.

This commit is contained in:
2025-03-14 17:45:38 +01:00
parent 2bea1ace33
commit 823261e1b0
112 changed files with 1190 additions and 2956 deletions

View File

@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
public GameObject Ground1, Ground2, Ground3;
bool hasGround = true;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void SpawnGround()
{
}
// platform "spawn" logic
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("Ground"))
{
hasGround = true;
}
}
private void OnTriggerExit2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("Ground"))
{
hasGround = false;
}
}
}

View File

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

View File

@@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
@@ -26,6 +24,7 @@ public class Health : MonoBehaviour
void TakeDamage()
{
// code from Christian
healthbar.fillAmount = (float)currentHealth / (float)maxHealth;
if (currentHealth <= 0)

39
Assets/Scripts/Stamina.cs Normal file
View File

@@ -0,0 +1,39 @@
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// code is similar to health
/// </summary>
public class Stamina : MonoBehaviour
{
public int maxStamina = 9;
public int currentStamina = 9;
public Image staminabar;
// stamina logic
void Start()
{
currentStamina = maxStamina;
}
// Update is called once per frame
private void Update()
{
UseStamina();
}
void UseStamina()
{
// code from Christian
staminabar.fillAmount = (float)currentStamina / (float)maxStamina;
// cd for stamina
// stamina reg
if (currentStamina < 0)
{
// longer cd for stamina reg
}
}
}

View File

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