Skip to content

ProjektKevin/Office-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Office Game - Hack&Roll 2026

A fully playable arcade game collection built entirely in Microsoft Excel VBA! Battle through classic Pong with dynamic barriers and cracking walls, then unlock a bonus Flappy Bird game through an epic egg-hatching cutscene.

๐ŸŽฏ Project Overview

This project was created for Hack&Roll 2026 (24-hour hackathon) and showcases the unexpected power of Excel as a gaming platform. No external libraries, no game enginesโ€”just pure VBA magic!

Games Included:

  1. Pong - Classic paddle game with modern twists
  2. Flappy Bird - Navigate through pipes with pixel-perfect collision
  3. Animated Cutscene - Smooth transition animation between games

โœจ Features

Pong Game

  • ๐Ÿ“ Classic Paddle Mechanics - Move up/down to keep the ball in play
  • ๐Ÿงฑ Dynamic Barriers - Obstacles spawn and degrade over time
    • 2-4 cell variable lengths
    • Horizontal & vertical orientations (80% vertical spawn rate)
    • Health-based color degradation
  • ๐Ÿงฑ Breakable Wall System - Hit the wall 5 times to break through
    • Progressive crack visualization
    • 2-cell thick wall with individual cell damage
  • ๐ŸŽจ Ball Trail Effect - Smooth motion trail behind the ball
  • ๐Ÿ“ˆ Difficulty Scaling - Ball speed increases over time
  • ๐Ÿ‰ Pixel Art Dragon - Hand-drawn boss behind the wall

Flappy Bird Game

  • ๐Ÿฆ Smooth Flight Mechanics - Gravity + flap physics
  • ๐ŸŽจ Custom Pipe Design - Hand-drawn pipe pixel art (replicated from template)
  • ๐Ÿ“Š Score Tracking - Points for each pipe passed
  • โšก Adjustable Difficulty - Configurable gap size, speed, and spawn rate
  • ๐ŸŽฎ One-Button Control - Simple flap button gameplay

Cutscene Animation

  • ๐Ÿฅš Egg Hatching Sequence:
    1. Ball flies to center stage
    2. Ball grows into egg (1x1 โ†’ 2x2 โ†’ 3x3 โ†’ oval)
    3. Cracks appear progressively
    4. Egg shakes and explodes
    5. Bird emerges and flies
  • ๐Ÿ’ฅ Wall Explosion - Wall pieces fly outward with physics (gravity + velocity)
  • ๐ŸŽฌ Smooth Frame Animation - Cell-based flipbook animation

๐ŸŽฎ How to Play

Setup

  1. Open PongGame.xlsm in Microsoft Excel (macros enabled)
  2. Go to the Menu sheet
  3. Click "Start Game" to begin Pong

Pong Controls

  • Up Button (or click cell) - Move paddle up
  • Down Button (or click cell) - Move paddle down
  • Objective: Hit the wall 5 times to break through and win!

Flappy Bird Controls

  • FLAP Button - Make the bird jump
  • Objective: Navigate through pipes and get the highest score!

Game Flow

Menu โ†’ Pong โ†’ Wall Breaks โ†’ Explosion Animation โ†’ 
Egg Hatching โ†’ Bird Emerges โ†’ Flappy Bird โ†’ Game Over โ†’ Menu

๐Ÿ—๏ธ Technical Architecture

File Structure

PongGame.xlsm
โ”œโ”€โ”€ Sheets
โ”‚   โ”œโ”€โ”€ Menu (Game selection)
โ”‚   โ”œโ”€โ”€ Pong (Main game board)
โ”‚   โ””โ”€โ”€ FlappyBird (Bonus game board)
โ””โ”€โ”€ VBA Modules
    โ”œโ”€โ”€ Module1 (Pong game logic)
    โ”œโ”€โ”€ Module2 (Cutscene animations)
    โ””โ”€โ”€ Module3 (Flappy Bird logic)

Key Technologies

  • VBA (Visual Basic for Applications) - All game logic
  • Excel Cells as Pixels - Visual rendering system
  • Timer-Based Game Loop - Application.OnTime for smooth animation
  • RGB Color Manipulation - Custom color palettes and effects
  • Cell Interior Colors - Graphics rendering

Core Systems

1. Game Loop System

' Pong runs at 0.5 seconds per tick
' Flappy Bird runs at 0.15 seconds per tick
Application.OnTime GameTimer, "GameTick"

2. Collision Detection

  • Pong: Ball vs Paddle, Ball vs Barriers, Ball vs Walls
  • Flappy Bird: Bird vs Pipes, Bird vs Ground, Bird vs Ceiling
  • Pixel-perfect hitbox calculations

3. Animation System

  • Frame-based animation using DoEvents loops
  • Physics simulation (gravity, velocity, friction)
  • Particle system for wall explosion

๐ŸŽจ Design Decisions

Why Excel?

  • Accessibility - Everyone has Excel, no installation needed
  • Challenge - Pushing Excel beyond its intended use
  • Visual Grid - Perfect for pixel art and retro games
  • Hackathon Novelty - Unique approach for a 24-hour sprint

Performance Optimizations

  • Application.ScreenUpdating = False during rendering
  • Efficient cell range clearing (batch operations)
  • Minimal redraw operations (only changed cells)
  • Timer-based game loop (non-blocking)

๐Ÿ› Known Issues & Limitations

Performance

  • โš ๏ธ Laggy on older computers (Excel isn't optimized for gaming!)
  • โš ๏ธ Animation framerate depends on CPU speed
  • โš ๏ธ Large number of active timers can cause slowdown

Excel Quirks

  • โš ๏ธ Application.OnTime can sometimes queue multiple callbacks
  • โš ๏ธ Macros must be enabled (security warning)
  • โš ๏ธ Doesn't work in Excel Online (desktop only)

Gameplay

  • โš ๏ธ Flappy Bird collision could be more forgiving
  • โš ๏ธ No sound effects (VBA Beep is too basic)
  • โš ๏ธ No high score persistence across sessions

๐Ÿš€ Future Improvements

Potential Features

  • ๐Ÿ”Š Sound System - Use Windows API for better audio
  • ๐Ÿ’พ High Score Tracking - Save to hidden sheet or external file
  • ๐ŸŽจ More Pixel Art - Additional enemy sprites
  • ๐ŸŽฎ Power-ups - Speed boost, shield, multi-ball
  • ๐Ÿ† Achievement System - Unlock skins, modes
  • ๐Ÿ‘ฅ Two-Player Mode - Competitive Pong
  • ๐ŸŒˆ Visual Effects - Screen shake, particle explosions
  • ๐Ÿ“ฑ Touch Controls - Better macro button placement

Code Refactoring

  • Separate rendering engine from game logic
  • Implement proper game state machine
  • Add configuration file for easy tuning
  • Create reusable animation framework

๐Ÿ“š What I Learned

Technical Skills

  • โœ… VBA advanced techniques (timers, user-defined types, modules)
  • โœ… Game loop architecture and timing
  • โœ… Collision detection algorithms
  • โœ… Animation and physics simulation
  • โœ… Excel object model deep dive

Game Design

  • โœ… Balancing difficulty curves
  • โœ… Player feedback systems (visual cues)
  • โœ… Progressive challenge design
  • โœ… Importance of playtesting

Hackathon Lessons

  • โœ… Scope management in time-limited projects
  • โœ… Rapid prototyping and iteration
  • โœ… Creative problem-solving with constraints
  • โœ… Making unconventional choices that stand out

๐Ÿ™ Acknowledgments

  • NUS Hackers - For hosting an amazing hackathon
  • Classic Arcade Games - Inspiration from Pong (1972) and Flappy Bird (2013)
  • Excel Community - For VBA documentation and examples

Created in 24 hours for Hack&Roll 2026
Proving that Excel is not just for spreadsheets! ๐Ÿ“Šโžก๏ธ๐ŸŽฎ

About

Office Game For Hack&Roll-2026

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published