This was my second ever team project (the people I worked with are linked on the itch page).
We were going to make a twin-stick shooter game, we were three developers and two artists.
We made this game in four weeks. With one week of pre-production and three sprints one week each.
This was a competition where we ended up getting second place.
My role in the project was, enemies, pickups, UI, menus, interactive parts of the map, etc.
So in the first sprint I made the enemies, the pickups, cleanups etc.
And in sprint two I made the screen loop and all the UI.
In sprint three. I made the interacting with doors, power generators and acid waste (the stuff you clean).
And then at the end of the last sprint I ended up helping with the player, making the stun attack and the cleaning.
And did all the sound effects.
Made with - Unity, C#, Librespirte
Released - 27 June 2024
4 week project, 5 person team
public class RoombaScript : MonoBehaviour
{
GameObject player;
PlayerMovement playerMovement;
NavMeshAgent agent;
bool playerIsCleaning = false;
[SerializeField] float despawnDistance = 100;
[SerializeField] GameObject epxlotion;
private void Start()
{
agent = GetComponent();
player = GameObject.FindWithTag("Player");
playerMovement = player.GetComponent();
}
private void Update()
{
// The enemy only works when you are not in the tutorial scene
if (SceneManager.GetActiveScene().name != "Tutorial")
{
float distanceToPlayer = Vector3.Distance(transform.position, player.transform.position);
// when the player is not active cleaning it the robot walks around chosing random location
// if the player starts doing something the robots destination becomes the position of the player
if (!playerIsCleaning)
{
if (agent.velocity.magnitude <= 0.1)
{
Vector3 ranomdPos = new Vector3(
transform.position.x + Random.Range(-5, 5),
transform.position.y + Random.Range(-5, 5),
transform.position.z + Random.Range(-5, 5));
agent.SetDestination(ranomdPos);
}
}
// When the player starts cleaning the enemy moves towards them
if (playerIsCleaning)
{
agent.SetDestination(player.transform.position);
}
if (playerMovement.IsActive)
{
playerIsCleaning = true;
}
else if (!playerMovement.IsActive)
{
playerIsCleaning = false;
}
// Despawn the enemy when player is too far away
if (distanceToPlayer >= despawnDistance)
{
Destroy(gameObject);
}
}
}
private void OnCollisionEnter(Collision collision)
{
// When the enemy hits the player it explodes and deals damage to the player.
if (collision.gameObject.CompareTag("Player"))
{
FindObjectOfType().Play("Explotion");
Instantiate(epxlotion, transform.position, Quaternion.identity);
playerMovement.lives -= 3;
Destroy(gameObject);
}
}
}