hp
jblog
toc

Circle Mover

2015-07-04, post № 43

programming, Pygame, Python, #angle, #angles, #around, #around the center, #entities, #entity, #getCirclePos(...), #red, #spinning, #turning

Playing around with angles and my getCirclePos() function, I came up with these little entities. They have a center, a distance to that center and an angle which constantly increases. Those parameters also randomly change.

circle-mover-1.png
circle-mover-3.png
circle-mover-4.png
Source code: circle-mover.py
Extra assets: circle-mover-2.png

Primes

2015-06-28, post № 42

mathematics, programming, Pygame, Python, #generates, #generator, #prime, #prime generator, #prime layout, #prime numbers, #prime pattern, #prime patterns, #primes, #red, #white

Being fascinated with how prime spirals look, I tried another layout for primes. Starting at the upper left and writing out numbers like a normal text, starting at 𝟢 and coloring every prime number red, every other number white, this is the result.

primes-8.png
primes-7.png
primes-10.png

It is interesting, that — like in prime spirals — the red squares form visible patterns. Randomly assigned squares would not as often form such patterns.

Source code: primes.py

Bubbletree

2015-06-27, post № 41

programming, Pygame, Python, #around, #bubbles, #circle, #colors, #fancy, #getCirclePos(), #gray, #gray tones, #red, #smoke

This program falls into the category ‘fancy, but not useful’. It basically starts with one circle, which spawns in new ones. The maximum number of circles is 𝟣𝟢𝟢, their color is a gray tone (rgb between 𝟧𝟢 and 𝟣𝟢𝟢).

bubbletree-1.png
bubbletree-3.png
bubbletree-5.png
Source code: bubbletree.py

FS Letters II

2015-06-21, post № 40

programming, Pygame, Python, #black, #dynamic, #file, #file check, #file system, #files, #filesystem, #fs, #red

Improving my first version — FS Letters — I changed a core behavior. Instead of going through the whole file system, saving it, interpreting it and then displaying it, I now went for a dynamic approach. As the filesystem gets checked (𝟨𝟢 times per second), the screen is also updating. This makes for both a more efficient (no freeze!) and a much nicer program. If the program is done checking the file system, the text ‘done’ will appear in the screen’s caption.

fs-letters-ii-1.png
fs-letters-ii-2.png
fs-letters-ii-4.png
Source code: fs-letters-ii.py
Extra assets: fs-letters-ii-3.png

Jake

2015-06-20, post № 39

games, programming, Pygame, Python, #apples, #simple, #simple snake, #snake, #snake game, #snakes, #video game

Continuing to clone famous and fairly easy games, I now made my own version of Snake.
In this version you cannot leave the screen, there are never more than three apples on the screen and there are no blocks inside the field.
Your current score is displayed in the screen caption.
To get more information about Snake, check this Wikipedia entry.

Controls

  • Arrow keys move the snake,
  • Escape pauses and unpauses the game,
  • ‘r’ resets the game.
jake-1.png
jake-2.png
jake-4.png
Source code: jake.py
Extra assets: jake-3.png

Dig

2015-06-14, post № 38

art, #adventure, #burn, #dig, #digger, #digging, #exploration, #failed mission, #fire, #hot, #lava, #pixel, #pixel friend, #pixel guy, #straight tunnel, #tunneling, #tunnelling

Being curious of the world underneath his feet, our little pixel friend started an exploration. Who knew what torrid situation he could get in to…

dig.gif

Jong

2015-06-13, post № 37

games, programming, Pygame, Python, #arcade, #black, #com, #computer playing, #game, #games, #green, #Pong

After having programmed my own Tetris clone — Jetris —, I thought of another game to clone. A really fun and fairly simple game came to my mind: Pong.
After a few hours I managed to do it and here it is.
I even implemented the computer being able to play, although it never loses… If a hitter is controlled by the computer is indicated by its color (green for players, red for the computer).
To get more information about Pong, visit this Wikipedia entry.

Controls (general)

  • Escape pauses and unpauses the game,
  • ‘r’ resets the game.

Controls (left player)

  • ‘w’ moves the (left) hitter up,
  • ‘s’ moves the (left) hitter down,
  • Left arrow key while pause changes if player is computer or user controlled.

Controls (right player)

  • Up arrow key moves the (right) hitter up,
  • Down arrow key moves the (right) hitter down,
  • Right arrow key while pause changes if player is computer or user controlled.
jong-1.png
jong-3.png
jong-4.png
Source code: jong.py
Extra assets: jong-2.png

Jetris

2015-06-07, post № 36

games, programming, Pygame, Python, #another Tetris clone, #arcade, #brick, #bricks, #colored bricks, #computer game, #game, #game clone, #games, #j's Tetris, #j-Tetris, #placing bricks, #Pygame Tetris, #Quadrapassel, #Tetris, #Tetris clone

Being generally very interested in games I recently stumbled across a Tetris clone, Quadrapassel. It really cought my attention and after playing for a long time I decided to program a Tetris clone myself.
There may still be a few inconsistencies but all in all I think it works very well.
Your game score will be shown in the window’s caption along with the info if the game is over yet.
To see further details about Tetris, visit this Wikipedia entry.

jetris-16.png

Controls

  • Left arrow key to move the brick to the left,
  • Right arrow key to move brick to the right,
  • Up arrow key to rotate the brick (clockwise),
  • Down arrow to increase the brick’s fall speed,
  • Space to bring the brick to the far bottom,
  • Escape to pause and unpause the game,
  • Tab to toggle if a fake brick is shown where the brick will land,
  • Right shift to toggle brick looks,
  • Backspace to start a new game.
jetris-6.png
jetris-8.png
jetris-11.png
Source code: jetris.py
Jonathan Frech's blog; built 2024/10/27 23:46:30 CET