2015-10-18, post № 74
games, programming, Pygame, Python, #acceleration, #c't, #car, #mouse, #mouse controlled, #position, #race, #ractrack, #track, #vector, #velocity, #vertrac't
In a recent c’t article they showed a game regarding vector mathematics, velocities, accelerations and positions.
I could not resist and wrote this program to simulate the game.
The only thing this program cannot do is to check the barriers. That you have to check for yourself.
The Game
You have a start position (red), an end position (green) and some barriers (white).
Your job is it to steer your little dot (bright yellow) onto the end position.
To make it more difficult, you are not allowed to change the dot’s position directly, but rather you accelerate it on each step.
Your acceleration vector (turquoise) also is not allowed to be longer than 𝟣𝟢 (dim yellow bubble) and at the end point your dot must have a velocity of (𝟢, 𝟢).
The fewer moves you need, the better your steering abilities.
Controls
- Mouse movement changes the new acceleration vector applied in the next step,
- Left click moves one step,
- Right click is a undo for the latest move,
- Middle click moves the frame,
- ‘c’ clears all the moves made so far,
- ‘e’ exports current moves to a
.txt
file, - ‘Space’ saves a screenshot.
2015-10-17, post № 73
programming, Pygame, Python, #black, #glow, #mouse, #mouse controlled, #pixels, #red, #specs, #spread, #vector, #vector maths
Tinkering around with vectors, I created this fancy program. By left-clicking you spawn a white circle at your current mouse position. This circle then will emit a specific quantity of red pixels (which is 𝑐 = 𝟤 𝜋 𝑟 with 𝑟 = 𝟧𝟢). Those red pixels then get pushed across the screen until they eventually die out.
Controls
- Left click spawns in a circle,
- ‘Space’ saves a screenshot.
2015-10-11, post № 72
programming, Pygame, Python, #3-gon, #background, #gradient, #triangles, #vector, #vector mathematics, #vectors, #wallpaper
This program uses vector mathematics and colors to create triangular gradient. By simply left-clicking you create three points which then will be filled in with color.
Controls
- Left click adds a new position,
- ‘Space’ saves a screenshot.
Posts:
242-240, 239-237, 236-234, 233-231, 230-228, 227-225, 224-222, 221-219, 218-216, 215-213, 212-210, 209-207, 206-204, 203-201, 200-198, 197-195, 194-192, 191-189, 188-186, 185-183, 182-180, 179-177, 176-174, 173-171, 170-168, 167-165, 164-162, 161-159, 158-156, 155-153, 152-150, 149-147, 146-144, 143-141, 140-138, 137-135, 134-132, 131-129, 128-126, 125-123, 122-120, 119-117, 116-114, 113-111, 110-108, 107-105, 104-102, 101-99, 98-96, 95-93, 92-90, 89-87, 86-84, 83-81, 80-78, 77-75, 74-72, 71-69, 68-66, 65-63, 62-60, 59-57, 56-54, 53-51, 50-48, 47-45, 44-42, 41-39, 38-36, 35-33, 32-30, 29-27, 26-24, 23-21, 20-18, 17-15, 14-12, 11-9, 8-6, 5-3, 2-1Jonathan Frech's blog; built 2021/04/16 20:21:20 CEST