Breakout
Enumerations | Functions | Variables
Pong.cpp File Reference
#include <chrono>
#include <SDL2/SDL.h>
#include <SDL2_ttf/SDL_ttf.h>
#include <cstdint>
#include <SDL2/SDL_mixer.h>
#include "Ball.h"
#include "Paddle.h"
#include "Contact.h"
#include "PlayerScore.h"
#include "Brick.h"
#include "LTimer.h"
#include <string>
#include <glad/glad.h>
#include "ResourceManager.h"
#include <iostream>
#include <fstream>
Include dependency graph for Pong.cpp:

Enumerations

enum  Buttons { PaddleOneUp = 0 , PaddleOneDown , PaddleTwoUp , PaddleTwoDown }
 

Functions

bool init ()
 
void loadLevel (int level)
 Method to load the level from the scripts. More...
 
void setBricks (int level, SDL_Renderer *renderer)
 The method to set bricks. More...
 
int main (int argc, char *argv[])
 The main function i.e. More...
 

Variables

const int WINDOW_WIDTH = 1920
 The Width of the game window. More...
 
const int WINDOW_HEIGHT = 1080
 The Height of the game window. More...
 
const int FPS = 60
 The target FPS we are aiming for. More...
 
int levelArray [10][26]
 The 2D array for initializing the bricks. More...
 
Brick bricks [10][26]
 The 2D array of brick object. More...
 
int brickCounter
 The counter to keep track of number of bricks on screen. More...
 
int frameCount
 
int timerFPS
 
int lastFrame
 
int fps
 

Enumeration Type Documentation

◆ Buttons

enum Buttons
Enumerator
PaddleOneUp 
PaddleOneDown 
PaddleTwoUp 
PaddleTwoDown 

Function Documentation

◆ init()

bool init ( )

◆ loadLevel()

void loadLevel ( int  level)

Method to load the level from the scripts.

Parameters
levelthe level to be loaded

◆ main()

int main ( int  argc,
char *  argv[] 
)

The main function i.e.

Entry point to the program

The game loop

◆ setBricks()

void setBricks ( int  level,
SDL_Renderer *  renderer 
)

The method to set bricks.

Parameters
levelThe level to be loaded
rendererThe renderer of the game loop

Variable Documentation

◆ brickCounter

int brickCounter

The counter to keep track of number of bricks on screen.

◆ bricks

Brick bricks[10][26]

The 2D array of brick object.

◆ FPS

const int FPS = 60

The target FPS we are aiming for.

◆ fps

int fps

◆ frameCount

int frameCount

◆ lastFrame

int lastFrame

◆ levelArray

int levelArray[10][26]

The 2D array for initializing the bricks.

◆ timerFPS

int timerFPS

◆ WINDOW_HEIGHT

const int WINDOW_HEIGHT = 1080

The Height of the game window.

◆ WINDOW_WIDTH

const int WINDOW_WIDTH = 1920

The Width of the game window.