movement, automated enemies, automated players, basic abilities

This commit is contained in:
Sylvia 2026-06-09 05:27:47 -07:00
parent 23576e137e
commit f4344c4700
31 changed files with 4343 additions and 70 deletions

View file

@ -1,16 +1,38 @@
using System;
using UnityEngine;
public class PlayerSwitcher : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
[SerializeField] private Player player1;
[SerializeField] private AutomatedPlayer player1AI;
[SerializeField] private Player player2;
[SerializeField] private AutomatedPlayer player2AI;
// Update is called once per frame
void Update()
{
}
private void Update()
{
if(Input.GetKeyDown(KeyCode.E))
{
SwitchPlayers();
}
}
public void SwitchPlayers() //i bet if i made it a parameter i wouldn't have to make an if statement. but it's literally 5 am and i'm lazy
{
if (player1.enabled)
{
player1AI.enabled = true;
player1.enabled = false;
player2.enabled = true;
player2AI.enabled = false;
(player2.transform.position, player1AI.transform.position) = (player1AI.transform.position, player2.transform.position);
}
else
{
player2AI.enabled = true;
player2.enabled = false;
player1.enabled = true;
player1AI.enabled = false;
(player1.transform.position, player2AI.transform.position) = (player2AI.transform.position, player1.transform.position);
}
}
}