hp
jblog
toc

Rotating Squares

2016-01-03, post № 98

programming, Pygame, Python, #2015, #color, #colorful, #rotate, #rotating, #spin, #spinning, #square, #squares

Using the pygame.transform.rotozoom() function, a velocity argument and changing colors, this program rotates squares across the screen.

Controls

  • Left click spawns in a new square at current mouse position,
  • ‘Space’ takes a screenshot.
rotating-squares-2.png
rotating-squares-5.png
rotating-squares-9.png
Source code: rotating-squares.py

White Fireworks

2016-01-02, post № 97

programming, Pygame, Python, #2015, #black, #black and white, #celebration, #exploding, #explosion, #new year, #sparks, #star shape, #white

In the spirit of the new year, this program tries to mimic white fireworks exploding in the night sky.

white-fireworks-2.png
white-fireworks-5.png
white-fireworks-8.png
Source code: white-fireworks.py

Happy New Year

2015-12-31, post № 96

art, #2016, #firework, #fireworks, #gif, #happy, #happy new year, #new, #new year, #pixel, #pixel guy, #rocket, #year

Little pixel guy wishes you a happy 2016.

happy-new-year.gif

Prime Circle

2015-12-27, post № 95

mathematics, programming, Pygame, Python, #circles, #prime, #prime generator, #prime number, #prime numbers, #prime visualizer, #primes, #visualizing primes

Using circles to visualize prime appearance. The picture below is 𝟣𝟢𝟪𝟢 ⨉ 𝟩𝟤𝟢 pixels, thus showing numbers up to 𝟧𝟦𝟢 (on the far left and right).

prime-circle-1.png
Source code: prime-circle.py

Spinning Shapes

2015-12-26, post № 94

programming, Pygame, Python, #angle, #black, #generate, #generating, #generator, #length, #rotating, #shapes, #spinning, #white

Drawing lines according to length and angle, which change over time, this program creates pretty shapes. The changing values for both length and angle are saved in the image’s name.

spinning-shapes-30_length0.995_angle+99.png
spinning-shapes-38_length0.999_angle+90.1.png
spinning-shapes-44_length1.0001_angle+90.1.png
Source code: spinning-shapes.py
Extra assets: spinning-shapes-00.png, spinning-shapes-01.png, spinning-shapes-02.png, spinning-shapes-03.png, spinning-shapes-04_length0.7_angle+100.png, spinning-shapes-05_length0.9_angle+100.png, spinning-shapes-06_length0.9_angle+91.png, spinning-shapes-07_length1_angle+91.png, spinning-shapes-08_length1_angle+89.png, spinning-shapes-09_length1.00001_angle+89.png, spinning-shapes-10_length1.001_angle+89.png, spinning-shapes-11_length0.999_angle+89.png, spinning-shapes-12_length0.999_angle+89.png, spinning-shapes-13_length0.999_angle+89.png, spinning-shapes-14_length0.999_angle+89.png, spinning-shapes-15_length0.75_angle+30.png, spinning-shapes-16_length0.75_angle+40.png, spinning-shapes-17_length0.99_angle+90.png, spinning-shapes-18_length0.99_angle+90.png, spinning-shapes-19_length0.75_angle+60.png, spinning-shapes-20_length0.75_angle+61.png, spinning-shapes-21_length0.99_angle+61.png, spinning-shapes-22_length0.99_angle+61.png, spinning-shapes-23_length0.99_angle+61.png, spinning-shapes-24_length0.99_angle+61.png, spinning-shapes-25_length0.99_angle+61.png, spinning-shapes-26_length0.99_angle+99.png, spinning-shapes-27_length0.95_angle+99.png, spinning-shapes-28_length0.999_angle+99.png, spinning-shapes-29_length0.999_angle+99.png, spinning-shapes-31_length0.8_angle+99.png, spinning-shapes-32_length0.85_angle+99.png, spinning-shapes-33_length1.001_angle+99.png, spinning-shapes-34_length1.001_angle+99.png, spinning-shapes-35_length0.99_angle+90.png, spinning-shapes-36_length0.99_angle+90.01.png, spinning-shapes-37_length0.99_angle+90.1.png, spinning-shapes-39_length0.999_angle+90.1.png, spinning-shapes-40_length0.999_angle+90.1.png, spinning-shapes-41_length1.0001_angle+90.1.png, spinning-shapes-42_length1.0001_angle+90.1.png, spinning-shapes-43_length1.0001_angle+90.1.png, spinning-shapes-45_length0.9999999_angle+90.1.png, spinning-shapes-46_length0.9_angle+70.png, spinning-shapes-47_length0.99_angle+70.png, spinning-shapes-48_length0.999_angle+70.png

Merry Christmas

2015-12-24, post № 93

art, #animated gif, #candles, #Christmas, #Christmas gif, #Christmas tree, #gif, #happy, #happy Christmas, #merry, #merry Christmas, #pixel, #pixel art, #pixel Christmas, #pixel gif, #pixel guy, #tree, #x-mas, #xmas, #xmas gif

Little pixel guy wishes you a Merry Christmas.

merry-christmas.gif

Fourth Sunday in Advent

2015-12-20, post № 92

art, #Advent, #animated, #animated gif, #candle, #fourth, #fourth candle, #fourth Sunday in Advent, #fourth Sunday of Advent, #gif, #pixel guy, #Sunday

Lighting the fourth candle…

fourth-sunday-in-advent.gif

𝜋 Approximation

2015-12-19, post № 91

mathematics, programming, Python, #approximating, #approximation, #circle, #circle constant, #constant, #Euler, #infinite, #infinite sum, #pi, #sum

Using an infinite series shown by Euler, 𝜋 can be approximated.
The series goes as follows: \sum\limits_{n=1}^{\infty}\frac{1}{n^2}=\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\dots=\frac{\pi^2}{6}
By rearranging the equation, you get the following: \pi=\sqrt{6\cdot\big(\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\dots\big)}

pi-approximation.png
Source code: pi-approximation.py
Jonathan Frech's blog; built 2024/08/31 22:59:44 CEST