Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Splatris: Gravity Clash

A dual-perspective, territory-shifting multiplayer action-puzzle game built with the Godot Engine 4.7+.

In Splatris, two players clash on a single 10x24 grid. Instead of playing separately, players share the same board divided by a dynamic, pulsing boundary called the Equator.


🎮 Gameplay & Core Concept

  • Opposing Perspectives:
    • Player 1 (Neon/Cold Theme) controls blocks falling from the TOP down (+Y).
    • Player 2 (Pink/Warm Theme) controls blocks falling from the BOTTOM up (-Y).
  • Dynamic Equator: The boundary between territories starts at row 12. Clearing lines shifts it toward the opponent, and the shift rewards clearing multiple lines at once:
    • 1 line — cleared from the bucket, but the equator does not move.
    • 2 lines — equator shifts 1 row toward the opponent.
    • 3 lines — equator shifts 2 rows.
    • 4 lines (a "tetris") — equator shifts 4 rows (the maximum reward).
    • Player 1's clears push the equator down (restricting P2); Player 2's clears push it up (restricting P1). Because the boundary moves, each side's play area — and where lines complete — continually changes.
  • Crush Win Condition: If a player's territory is pushed all the way to their spawn zone (Equator <= 2 for P1, or Equator >= 22 for P2), they are crushed and their opponent wins the match.
  • Next-Piece Queues: The upcoming 4 pieces for each player are previewed in rounded, glowing panels to the right of the bucket — Player 1's queue at the top (pieces rise as they are consumed) and Player 2's at the bottom (pieces sink as consumed), each easing smoothly into place. Both players draw from a single shared 7-bag sequence, so each receives the same pieces in the same order — the randomizer deals every one of the seven tetrominoes before repeating, eliminating long runs of the same piece.
  • Lock Delay: A piece that lands after a soft drop gets a brief grace period before it locks, so you can still slide or rotate it under an overhang. Moving or rotating refreshes the timer (up to a cap); a hard drop bypasses the delay and locks instantly.

🕹️ Game Modes

1. 1-Player: Boss Climb (VS AI)

Face off against a formidable heuristic AI opponent that drives Player 2 (bottom-up). The AI evaluates every rotation/column, then re-scores its strongest options using the known next piece (1-step lookahead), so it deliberately sets up the multi-line clears that push the equator rather than wasting rows on single clears. It minimises holes, keeps its stack flat, and never chokes its own spawn — playing at full skill from the start.

  • Equator-Focused Strategy: Because only 2+ line clears move the boundary, the AI hoards rows for doubles/triples/tetrises and downstacks a single only when survival demands it.
  • Difficulty via Speed, not Skill: The AI's decisions are always optimal; what makes early levels beatable is its reaction time and movement speed. At level 1 it is deliberately sluggish; as you level up these ramp toward near-instant, letting a perfect brain execute at full pace.
  • Progressive Difficulty: Every 5 lines you clear, the game levels up, speeding up both your gravity and the AI. Tuning constants (AI_REACT_*, AI_MOVE_*, AI_DROP_*) live at the top of scripts/game_boss.gd.
  • Adaptive Planning: Because Player 1's line clears move the equator, the AI re-plans its current piece whenever the boundary shifts.

2. 2-Player: Same Screen (Local)

Play local split-screen with a friend on the same keyboard.

  • Dual Cameras: Player 1's camera is oriented normally, while Player 2's camera is rotated 180 degrees so both players view their respective pieces falling "down" from their perspective.
  • Shared Physics & World: Both viewports share a single 2D world space in real-time.

3. 2-Player: Networked (Multiplayer)

Play online or over a local network using Godot's high-level multiplayer API (ENetMultiplayerPeer).

  • Host / Join Flow: Host a server (listening on port 12345) or connect to a host via IP address.
  • Authoritative Server Sync: Host performs authoritative game state updates, line clears, and equator shifting, and broadcasts state to the client.
  • Perspective Rotation: The client's view is automatically rotated 180 degrees to preserve the bottom-up perspective.

⌨️ Controls Reference

Player 1 (Top-Down / Cold)

Action Key
Move Left Z
Move Right X
Rotate Clockwise ' (Apostrophe)
Rotate Counter-Clockwise / (Slash)
Soft Drop Space
Hard Drop Enter

Player 2 (Bottom-Up / Warm)

Note: In local and networked play, P2 controls are mapped to represent directional actions relative to their 180° rotated perspective.

Action Key
Move Left Left Arrow
Move Right Right Arrow
Rotate Up Arrow
Soft Drop Down Arrow
Hard Drop Enter

🛠️ Technical Stack & Architecture

  • Engine: Godot 4.7+
  • Language: GDScript 2.0
  • Graphics & Rendering:
    • GL Compatibility renderer.
    • Custom dynamic Starfield Shader (assets/shader_starfield.gdshader) for the space background.
    • Programmatic styling of buttons, labels, and panels to create a glowing neon/cyberpunk aesthetic.
    • CPUParticles2D-powered explosion bursts for line clears.
    • Smooth linear interpolation (lerp) of blocks and the equator boundary to ensure fluid visual transitions.
  • Audio:
    • Dedicated sound manager autoload (SoundManager) handling sound effects for rotating, locking pieces, clearing lines, and game over sequences.

🚀 How to Run

  1. Download and install Godot Engine 4.7 (or compatible 4.x version).
  2. Clone or download this project folder.
  3. Open Godot Engine and import the project via project.godot.
  4. Run the project (default main scene: res://scenes/menu.tscn).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages