Roombarena
A chaotic local multiplayer shooter where 2–4 cats battle on Roombas in a destructible house.
Overview
Players ride Roombas around a house and shoot each other. You score by hitting opponents and by vacuuming up debris from broken furniture. The more debris you collect, the stronger you get, so every match ends with the house in pieces.
We made it as a team of seven students: three developers, three artists and a sound designer. The idea started as a competitive tank game and quickly turned into the chaos, cats and destruction of the final game. Creative decisions were shared evenly between everyone on the team.
My contributions
- Projectile physics and mechanics: reflection-based wall bounces with a bounce limit, and a separate collision response for each surface type.
- Hit detection and player health: collision handling, damage handling and invincibility windows.
- Vacuuming: detection of debris with a sphere overlap query, and physics-controlled absorption of the objects.
- Special attacks: four additional projectile types with different behaviours, and a charge system that selects the attack by hold time and energy.
- Animation: I placed the animations the artists made in the game and hooked them up, so they are timed correctly and play properly during the right events.
- Helped make the game's trailer.
Technical breakdown
Selected excerpts from my Unity C# code, shortened for readability. The full repository is private because it was a team project.
BulletMove is the base class for every projectile. Collision responses for each surface type (wall, furniture, other projectile,
player, breakable wall) are separate protected virtual handlers, so each special projectile only overrides what makes it different.
Homing projectile
The football projectile homes in on the nearest opponent for a limited time. Instead of snapping to the target, it rotates its velocity
towards it with Vector3.RotateTowards at a capped turn rate, so the path curves smoothly and can be dodged. Tracking stops when the timer ends
or when the projectile hits a wall, which is a single override that calls the base handler. Duration and turn rate are exposed in the inspector for tuning.
public class FootballProjectile : BulletMove
{
protected override void FixedUpdate()
{
if (_isTracking && _target != null)
{
_trackingTimer += Time.fixedDeltaTime;
if (_trackingTimer >= _trackingDuration)
{
_isTracking = false;
DestroyLockon();
MaintainSpeed();
}
else
{
Vector3 dir = (_target.position - transform.position).normalized;
dir.y = 0f;
// Turn towards the target at a limited rate
Vector3 newDir = Vector3.RotateTowards(
_rb.linearVelocity.normalized, dir,
_trackingStrength * Mathf.Deg2Rad * Time.fixedDeltaTime, 0f);
_rb.linearVelocity = newDir * _speed;
}
}
// ...
}
protected override void HandleWallCollision(Collision collision)
{
_isTracking = false;
DestroyLockon();
base.HandleWallCollision(collision);
}
}
Heavy projectile through overrides
The bowling ball reuses the base projectile but changes how it behaves. It stores an intended direction and re-applies it every physics step, so contacts cannot slow it down or change its heading. It destroys incoming bullets, and plows through furniture once the furniture breaks instead of bouncing off it. Players it hits are knocked back by a timed coroutine that moves their character controller.
public class BowlingBallProjectile : BulletMove
{
protected override void FixedUpdate()
{
// Store intended velocity so bounce reflections use the correct pre-collision direction
_lastVelocity = _intendedDirection.normalized * _speed;
_rb.linearVelocity = _lastVelocity;
}
protected override void HandleBulletCollision(Collision collision)
{
// Ignore bullets fired by the same player
BulletMove incoming = collision.gameObject.GetComponent<BulletMove>();
if (incoming != null && incoming.OwnerRoot == _ownerRoot) return;
Destroy(collision.gameObject);
}
protected override void HandleFurnitureCollision(Collision collision)
{
DestructibleObject destructible = collision.gameObject.GetComponentInParent<DestructibleObject>();
if (destructible != null)
{
destructible.ImpactLocation = collision.GetContact(0).point;
destructible.TakeDamage(_destructableDamage);
if (destructible.IsBroken)
{
// Plowed through - ignore further collisions with this piece and keep rolling
Physics.IgnoreCollision(GetComponent<Collider>(), collision.collider, true);
_rb.linearVelocity = _intendedDirection.normalized * _speed;
return;
}
}
// ...
}
private IEnumerator ApplyKnockback(CharacterController cc, Vector3 direction)
{
float elapsed = 0f;
while (elapsed < _knockbackDuration)
{
if (cc == null || !cc.enabled) yield break;
cc.Move(direction * _knockbackForce * Time.deltaTime);
elapsed += Time.deltaTime;
yield return null;
}
}
}
Energy reservation for charged attacks
Holding the fire button charges through three tiers by elapsed time, and each tier costs energy. When the selected tier changes, the energy reserved for the previous tier is refunded and the cost of the new tier is reserved, so cancelling the charge or switching tiers never loses or duplicates energy.
// Selecting a tier (inside SetSpecial)
float cost = GetCost(type);
if (_energy.Energy + _reservedEnergy < cost)
{
return;
}
// Refund the previously reserved tier, then reserve the new cost
_energy.Energy += _reservedEnergy;
_reservedEnergy = cost;
_energy.Energy -= _reservedEnergy;
// Cancelling the charge (inside ResetEffects)
_energy.Energy += _reservedEnergy;
_reservedEnergy = 0f;
Wall bounces
The projectile caches its velocity at the start of every physics step, because the physics engine may already have changed it
when the collision callback runs. On a wall hit the cached direction is reflected around the contact normal with
Vector3.Reflect, flattened onto the ground plane, and re-applied at a constant speed. The speed is also re-normalised each
step, so bounces never add or remove energy. After a set number of bounces the projectile is destroyed.
protected virtual void FixedUpdate()
{
_lastVelocity = _rb.linearVelocity;
// ...
}
protected virtual void HandleWallCollision(Collision collision)
{
_bounceCount++;
if (_bounceCount >= _maxWallBounces)
{
DestroyProjectile();
return;
}
Vector3 velocityToReflect = _lastVelocity.magnitude > 0.01f ? _lastVelocity : transform.forward * _speed;
Vector3 reflected = Vector3.Reflect(velocityToReflect.normalized, collision.contacts[0].normal);
reflected.y = 0f;
_rb.linearVelocity = Vector3.zero;
_rb.AddForce(reflected.normalized * _speed, ForceMode.VelocityChange);
}
Challenges
- Projectiles that react to what they hit: I made projectiles bounce off walls and react differently depending on what they hit, and gave each special projectile its own behaviour.
- Getting the feel right: early on the game felt slow and clunky, and our first playtesters were underwhelmed and a bit confused. We responded to that feedback with faster movement, a bigger map and more power for the player. It also meant taking the game from a simple prototype, to the mechanics, to placing models and animations, so I got to take a product from start to finish.
- Perforce: it was my first time working with it, on a team where everyone's changes had to come together.
- Playtesting feedback: we were passionate about what we built, so it was hard to hear criticism. We had to put our biases aside and understand the feedback even when we didn't agree with it.
- Accountability: everyone logged their tasks and hours on HacknPlan, so everyone was accountable for the time they put in.
Teamwork
It was interesting to have an equal say in the decisions as a team. We planned and tracked all our tasks on HacknPlan, where everyone also logged their hours, so it was clear who was working on what. We used Perforce for version control. Programmers, artists and the sound designer handed work over to each other, and I connected the animations the artists made to the gameplay.