jblog
toc

JClock IV

2015-08-08, post № 53

programming, Pygame, Python, #alternative, #arc, #around the center, #background, #clock, #clockface, #displaying time, #draw, #rgb, #rgb clock, #rgbw, #spawn time, #time, #time display, #time reading

Combining the built-in Pygame function pygame.draw.arc() with time, I came up with this alternative clock design.
The red arc represents hours, the green one minutes, the blue seconds and the white arc represents centiseconds (a hundredth of a second).
Although it is a clock, you read it anti-clockwise.

jclock-iv-2.png
Source code: jclock-iv.py
Extra assets: jclock-iv-1.png

Pattern

2015-08-02, post № 52

programming, Pygame, Python, #art, #backgroud, #color, #colors, #diamond, #entities, #entity, #gradient, #move, #movement, #moving, #pipes, #wallpaper

Using colors and entities, this program can generate some nice-looking pictures. The entities move randomly across the screen, always staying in a grid layout. Their color is defined by an increasing tick variable, which gives them a nice gradient.

Controls

  • ‘Space’ spawns in new entities,
  • ‘m’ pauses and resumes the movement of entities.
pattern-1.png
pattern-2.png
pattern-4.png
Source code: pattern.py

Jeakout

2015-08-01, post № 51

games, programming, Pygame, Python, #arcade, #arcade game, #Atari, #break, #break blocks, #breaking, #breaking blocks, #com, #computer play, #game, #games

Continuing with my arcade game replicas, I programmed Breakout.
This version is fairly simple. Your lives will be displayed at the lower right corner, your points in the screen’s caption. There also is a computer implementation, which — as in Jong — cannot lose.

Usage

  • Left arrow key moves the hitter to the left,
  • Right arrow key moves the hitter to the right,
  • ‘Space’ toggles computer play.
jeakout-1.png
jeakout-2.png
jeakout-3.png
Source code: jeakout.py
Jonathan Frech's blog; built 2021/04/16 20:21:20 CEST