Skip to content
View lnivan's full-sized avatar

Block or report lnivan

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
lnivan/README.md
lnivan, maths undergrad: games, simulations and small tools. An animated wireframe cube rotates next to a planet and its moon orbiting a star.

I'm a maths undergraduate. This is a compendium of small programming projects I've been doing through the years, mostly early high-school experiments but things I'm working on now. Most of them are physics simulations, games and small tools, written in Python.

The repositories were uploaded recently, so their commit dates don't show when each project was written. Each README explains how the project works, how to run it and what is still unfinished.

Featured

A wireframe cube seen from a camera moving around it A 3D renderer written from scratch, without any graphics or 3D library. It implements its own vector and matrix classes, rotation matrices and perspective projection, and lets you fly a camera around the scene with the keyboard and mouse.

Related: Geometry Viewer 3D, a 3D point viewer built on its own vector and matrix classes.

Python · Pygame
A mass–spring simulator with its own physics module: point masses connected by damped springs, gravity and semi-implicit Euler integration. The demo shows a chain of 51 masses swinging between two heavy anchors.

Python · Pygame
A chain of masses hanging and oscillating between two anchors
A small ship firing at asteroids that split when hit A version of the arcade game written in a single Pygame file, with inertial ship movement, missiles, screen wrap-around and asteroids that split into smaller pieces when hit. The ship and asteroids are drawn from vertex lists in polar coordinates rather than sprites.

Python · Pygame

Simulations

A stick-figure ragdoll picked up by its chest, swung around, tossed, caught and set back down
Ragdoll Physics
An interactive 2D ragdoll built from point masses, rigid distance constraints and spring–damper joints, integrated with position Verlet. The figure can be dragged, thrown and pushed.
Python · NumPy · Pygame
A ring of point masses falling and deforming against the floor
Soft Body Sim
A soft-body simulation: a ring of point masses in which every pair is joined by a damped spring, deforming under gravity when it hits the floor.
Python · Pygame
Balls of different sizes colliding inside a box
Elastic Ball Collisions
Elastic collisions between balls of different masses, with each impact resolved along the line joining their centres.
Python · Pygame
Zooming out during a flight: the outline of Earth appears with the predicted trajectory around it
Rocket Orbit Sim
A rocket launched from a real-scale Earth under Newtonian gravity, with steerable thrust, zoom and a live prediction of its trajectory.
Python · Pygame

Also: N-Body Gravity, a gravitational simulation of a star, a planet and its moon, each attracting the others.

Games and graphics

A pixel-art player walking, building, digging and setting off TNT in a 2D block world
Minecraft 2D
A side-view block sandbox with procedurally generated terrain, gravity and collisions, block placement and removal, and TNT explosions.
Python · Pygame
A ball launched like a slingshot flying past obstacles towards a target
Parabola Targets
A physics puzzle game: launch a projectile with a slingshot-style control and get it past the obstacles into the target, across several levels.
Python · Pygame
Tetris pieces falling, rotating and clearing rows on a 10 by 20 board
Tetris
A Tetris clone with the seven tetrominoes stored as 5 × 5 matrices, precomputed rotations, soft drop and line clearing.
Python · Pygame
A recorded game of terminal Minesweeper: coordinates are typed and the board opens up
Terminal Minesweeper
Minesweeper played in the terminal, with a configurable board size and number of mines and a breadth-first flood fill that opens empty regions. The interface is in Spanish.
Python

Tools

Illustration: press Ctrl+Shift+A, select part of the screen, and an explanation appears in a floating window
Screen Explainer
A desktop utility started with a global hotkey. The selected region of the screen is sent to the Gemini API, and the explanation appears in a floating window (illustration).
Python · PyQt6 · Gemini API
Animation of the route the snake bot follows on an 11 by 11 board
Snake Autoplayer
A bot that plays a browser Snake game by reading the screen and sending keystrokes. It alternates between two fixed routes that together cover the whole board (one is shown above).
Python · Pillow

Also: Image Grid Splitter, a utility that splits an image into a 4 × 4 grid for printing it as a poster.

Popular repositories Loading

  1. asteroids asteroids Public

    A vector-style arcade shooter where every ship and rock is a polygon stored in polar coordinates.

    Python

  2. spring-mass-simulator spring-mass-simulator Public

    A string of 51 point masses on springs sags and swings between two heavy anchors, stepped with semi-implicit Euler.

    Python

  3. ragdoll-physics ragdoll-physics Public

    A 2D stick-figure ragdoll made of seven point masses, rigid sticks and damped springs, stepped with position Verlet.

    Python

  4. parabola-targets parabola-targets Public

    A slingshot puzzle game: drag back to launch a ball on a parabolic path around walls and into a target.

    Python

  5. wireframe-3d wireframe-3d Public

    A pure-Python wireframe renderer with hand-written vectors, matrices, perspective projection and a fly camera.

    Python

  6. geometry-viewer-3d geometry-viewer-3d Public

    A small 3D point viewer built on hand-written vector and matrix classes, with a perspective camera you can fly and turn.

    Python