Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

How to make a game like Pong with Felgo

How to make a game like Pong with Felgo

Tutorial Chapters

  1. Overview
  2. Creation of a Felgo game
  3. GameWindow, Scenes and Physical Worlds
  4. The Level and the Ball
  5. Level Boundaries
  6. Paddles
  7. HUD
  8. Menus
  9. AI
  10. Special Effects
  11. Music and Sound
  12. Further Perspectives

Overview

In this tutorial, you will create a simple Pong game step by step, complete with collision detection, a ball bouncing with physics effects between paddles which can be dragged via touches. If you are new to Felgo, it may help to see Getting Started with Felgo and Qt Creator before proceeding with this tutorial.

Pong is a very popular game created by Atari in the 1970s. "Pong is a two-dimensional sports game that simulates table tennis. The player controls an in-game paddle by moving it vertically across the left side of the screen, and can compete against either a computer controlled opponent or another player controlling a second paddle on the opposing side. Players use the paddles to hit a ball back and forth. The aim is for a player to earn more points than the opponent; points are earned when one fails to return the ball to the other." - Citation from Wikipedia. More background information can be found on The Pong Story.

After a small brainstorming you might have an idea what will be needed in the game. This is a small list of components which are necessary for the game:

  • GameWindow with a Scene
  • Level
  • Ball
  • Wall
  • Goal
  • Paddles
  • HUD
  • In-game Menu
  • Main Menu
  • MenuButton
  • Music & Sounds

Now you know what might be necessary when building the game. So let's start and build VPong.

This game is also available with full source code when you download the Felgo engine in the <installation directory>/Demos/VPong directory. The online version is available here: VPong Demo.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded