Lazarus Tutorial #12 - Retro Style Pong Game

Previous tutorial


Have you ever wondered how to develop your own retro style pong game? Well, let’s find it out. In this video we will create our own pong game. Therefor you will learn how to develop a retro style UI, simple collision detection and game mechanic. In the end of this video series you should be able to develop your own applications for Windows, Linux and Mac. Moreover you should have understood the concept of programming and the necessary knowledge to continue your journey.

Published: 2016-12-15
Views: 11201
Tags: Lazarus, Tutorial, Programming, Learning, Applications, Windows, Linux, Mac, Game, Pong, Retro


In this video, you have learned:

  • Designing a retro style UI
    • Shapes
    • Labels (right and centre alignment)
    • Font settings (changing on runtime)
    • Anchors (akLeft, akRight, akTop) - let components adapt to different screens
    • Using a label as button
    • Background color
    • BorderStyle bsSingle - disallow to resize your form
    • BorderIcons.biMaximize := false - disallow to maximize the form
    • DoubleBuffered - better for rendering movements on a form
  • Advanced UI events
    • OnMouseMove - X, Y is relative to your component
    • OnMouseEnter - when you move the mouse on your component
    • OnMouseLeave - when you leave the mouse from your component
  • Developing a simple game mechanic
    • Working with coordinates
    • Defining a collision using a if statement
    • Control the paddle using the mouse
    • Using a timer to make the ball move
    • Score counting
    • Increasing speed
  • Using procedures to subdivide tasks
    • InitGame
    • GameOver
    • UpdateScore
    • IncreaseSpeed
  • Useful IDE features
    • Ctrl + J - rename multiple identifiers
  • Deploy your application
    • Release build mode
    • Cleanup and build


Project files :: 128 KB

This download contains the project files of this video.