What’s on your mind?

AI-generated answers may be inaccurate

Glimmer

  • Python
  • Pygame
  • Game development

Glimmer is a side-scrolling Pygame game I made in 2021 for a Python creative-programming competition, where it received first prize. I developed the first version from late April to early May, including player controls, obstacles, menus, audio, and scoring.

Glimmer in play

Jumping and gravity

A small spacecraft moves between obstacles on the upper and lower edges of the play area. It can jump or reverse gravity. Both actions require it to be grounded: jumping sets a velocity opposite the current gravity, while switching multiplies gravity by -1. The same movement update handles either direction.

Each frame updates velocity and position and handles the top and bottom boundaries. Collisions reduce health and start a short invulnerability period. Reaching zero health opens the game-over state. Score accumulates as the player survives.

Obstacles enter from the right and are removed after leaving the screen. Their generation alternates between the upper and lower space, adjusting parameters such as scroll speed as play advances. Two background sections scroll and repeat behind them.

Menus and sound

The start menu, settings, game, and game-over screen share one Pygame application. Images, fonts, and sounds are loaded together. Music and sound effects have independent switches saved in config.json.

An early README proposed a story moving from night to day, then immediately noted that the story had been cut. I finished the game around jumping, dodging, and switching gravity, with a round that runs from the start menu through to game over.

The start menu: play, settings, and exitThe start menu: play, settings, and exit