Snell Laser - Casual Physics
Description
Snell Laser is a hyper-casual puzzle game focused on the concepts of Geometric Optics. In it, the player is challenged to manipulate light beams using mirrors, glass blocks with different refractive indices, and beam splitters. The main objective is to guide the laser, bypassing opaque obstacles, until it hits the luminous targets. The game rewards optimized trajectories: paths that utilize more reflections and refractions generate higher scores, encouraging the player to explore the geometric possibilities of each level.
A Note for Physics Enthusiasts
The game is a playful representation of the Snell-Descartes Law (n₁ sinθ₁ = n₂ sinθ₂) and the Law of Reflection. In the simulation, by directing light toward a glass block, the player observes the deviation caused by refraction in real-time. A central element of the game is the practical application of the Critical Angle: when light travels from a denser medium to a less dense one, and strikes the interface at an angle greater than the critical angle, no refraction occurs into the external medium, resulting in what is known as Total Internal Reflection (TIR). The game scores these interactions distinctively, practically demonstrating these theoretical concepts.
Objective
The player must select and rotate the optical elements placed on the board to redirect the laser emitted by the source. To achieve higher ranks, you must optimize your score by making the light interact as many times as possible with the optical components before reaching the final destination.
Features
- Optical Element Manipulation: Full control over the rotation of Mirrors (pure reflection), Glass Blocks (refraction), and Splitters (50/50 beam division).
- Dynamic Scoring: The engine calculates events in real-time. Players accumulate points for each Reflection (x10), Refraction (x20), and Total Internal Reflection (x50).
- 12 Progressive Levels: Stages designed with increasing difficulty, ranging from simple deviations to complex circuits requiring multiple beam splits. Progress is saved locally in the player's browser.
- Custom Optical Engine: Light trajectories and collisions are calculated using a 2D Raycasting algorithm (AABB/OBB) developed entirely from scratch by the author, specifically tailored for the geometric needs of this simulation.
- Propagation Visual Effects: Visual markers (photons) travel along the light paths indicating the direction of propagation, while particle systems provide visual feedback upon hitting targets.
Scores and Skill Levels
Your rank in the game is defined by the sum of the highest scores obtained across all played levels:
- < 200: Beginner 🐣
- 200 – 399: Curious Student 🧐
- 400 – 599: Dedicated Student 📘
- 600 – 799: Novice University Student ✏️
- 800 – 999: Advanced University Student 📚
- 1000 – 1499: Physics Professor 🧑🏫
- 1500 – 1999: Optics Professor 🎓
- 2000 – 2499: Physics Genius 🧠
- 2500+: Willebrord Snellius ✨
How to Play
- Objective: Hit all circular targets simultaneously with the laser to clear the level.
- Challenges: The laser cannot pass through opaque blocks. Use beam splitters for multiple targets and refraction through glass to escape narrow corridors.
Controls:
💻 On PC:
- [ ⬆ ] / [ ⬇ ] or [ W ] / [ S ] : Cycle selection between board pieces.
- [ ⬅ ] / [ ➡ ] or [ A ] / [ D ] : Rotate the selected element to adjust the laser angle.
📱 On Mobile / Touch:
- [ ▲ ] / [ ▼ ] : Tap the virtual buttons on the left to switch the active piece.
- [ ⟲ ] / [ ⟳ ] : Hold the virtual buttons on the right to rotate the piece and calibrate the light with precision.
Change Language
You can switch between Portuguese and English by clicking the language button located on the main menu screen.
💻 A Note for Tech Enthusiasts
Snell Laser was entirely developed in a Linux Open-Source environment (EndeavourOS, running the KDE Plasma 6.6.3 interface over the 6.19.8-arch Kernel), using modest hardware (Intel Core i5-8250U with UHD Graphics 620). This reflects the project's philosophy: to create high-performance educational games accessible to run directly in the browser of any device, without requiring high-end hardware.
The great technological asset of this project is its proprietary MVC Framework written in TypeScript, developed and refined by the author over years of research in interactive simulations. This solid architectural base allows the game to run natively and responsively in mobile browsers, eliminating the need for forced fullscreen APIs or third-party app installations.
The software architecture and tech stack guarantee this performance:
- Language & Typing: TypeScript (v5.9.3) running in a Node.js (v25.8) environment.
- Graphics Engine: All 3D rendering and GUI systems are powered by the Babylon.js ecosystem (@babylonjs/core v8.52.0, @babylonjs/gui v8.52.0). Foregoing generic third-party physics engines (like Havok or Ammo), all geometric collision and light propagation logic was developed mathematically and independently.
- Build & Bundling: Vite.js (v7.3.1) was configured to compile ES6 modules, perform tree-shaking, and minify the source code, generating extremely lightweight chunks for the web.
Engineering and Design Patterns:
Data flow between modules is strictly organized by the MVC (Model-View-Controller) pattern via callbacks, a model already successfully used in previous games and simulations:
- Model Layer: Has no visual coupling and houses the
OpticsEngine, a custom-built Raycasting engine. It evaluates intersections against OBBs (Oriented Bounding Boxes) in real-time using linear algebra and pure trigonometry, reproducing the laws of geometric optics at ~60 FPS. - View Layer: Constructs the graphical interface at runtime via Babylon GUI and manages a reactive translation chain (
LanguageSwitcher). - Controller Layer: Processes hardware listeners and coordinates request rate throttling for physical calculations, saving battery life on mobile devices.
- GPU Optimization (Factory Pattern): To handle the memory limitations of mobile browsers, the
MaterialFactorypattern was implemented. The engine "freezes" single instances of 3D materials in the video card's memory and merely reassigns pointers during level transitions, completely nullifying Garbage Collection overhead and shader recompilation stutters.
License
This project is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License (CC BY-ND 4.0). You are free to share, copy, and redistribute the game in any medium or format, including for commercial purposes, provided appropriate credit is given to the author, Rafael João Ribeiro, and the website www.fisicagames.com.br. The creation of derivative works or any modification to the original source code is not permitted.
Copyright (c) 2026 Rafael João Ribeiro.
Author
This project was developed by:
Prof. Dr. Rafael João Ribeiro
Federal Institute of Paraná (IFPR)
www.fisicagames.com.br
Ribeiro, R. J. (2026). Snell Laser: A Hyper-Casual Geometric Optics Puzzle Game and Interactive Simulation (1.0.1). Zenodo. https://doi.org/10.5281/zenodo.19261559
| Published | 8 days ago |
| Status | Released |
| Platforms | HTML5 |
| Author | Física Games |
| Genre | Simulation, Educational, Puzzle |
| Tags | 3D, babylonjs, browser, Casual, mobile, Physics, typescript |
| AI Disclosure | AI Assisted, Code, Text |


Leave a comment
Log in with itch.io to leave a comment.