Vishal Jangid

Vishal Jangid

Cube Coordination

October 24th 2023

Unity
2D

Visit project on:

Demo

Cubed Coordination is a 2D cooperative puzzle platformer built using the Unity game development engine. The game leverages the Unity physics engine for realistic cube movements and interactions with the environment. The dynamic gameplay revolves around controlling two cubes simultaneously, each moving in opposite directions on a single screen.

Concept

Player

Cube Coordination | Two Cubes | Player

Key Technical Features

Rigidbody2D Physics

The game's core movement mechanics are powered by Unity's Rigidbody2D component, providing realistic physics-based interactions for the cubes.

Object-Oriented Programming (OOP)

The game follows OOP principles, with a modular structure for cube control, allowing easy extension for potential future features.

CanvasGroup Alpha Tweens

The script incorporates CanvasGroup alpha tweens for smooth fading effects during certain interactions, enhancing the overall visual experience.

public static IEnumerator FadeCanvasGroup(CanvasGroup canvasGroup, float targetAlpha, float duration)
    {
        if (canvasGroup == null)
        {
            UnityEngine.Debug.LogWarning("CanvasGroup is null.");
            yield return null;
        }

        canvasGroup.interactable = false;
        canvasGroup.blocksRaycasts = false;

        float elapsedTime = 0f;
        float startAlpha = canvasGroup.alpha;

        while (elapsedTime < duration)
        {
            elapsedTime += Time.deltaTime;
            canvasGroup.alpha = Mathf.Lerp(startAlpha, targetAlpha, elapsedTime / duration);
            if (elapsedTime >= duration)
            {
                canvasGroup.alpha = targetAlpha;
                canvasGroup.interactable = targetAlpha > 0;
                canvasGroup.blocksRaycasts = targetAlpha > 0;
            }
            yield return null;
        }
    }

Dynamic Level Design

Cubed Coordination features dynamically designed levels with various obstacles, puzzles, and interactive elements to challenge players and encourage teamwork.

User Interface (UI)

A minimalist UI provides essential information to players.

Tag-Based Collision System

The collision system utilizes Unity's tag system for platform differentiation, allowing distinct interactions based on platform type.

PlayerPrefs Storage

The PlayerPrefs system is employed to store and retrieve volume status, current level and best time for particular level.

Smooth Rotation Script

The SmoothRotation script uses quaternion rotations and Time.deltaTime to smoothly rotate game objects on their Z-axis with customizable speed and intervals.