Box2D Cannon Game
Ian Parberry's "Introduction to Game Physics with Box2D"
Enumerations | Functions | Variables
GameDefines.h File Reference

Game specific defines. More...

#include "Defines.h"
#include "Box2D\Box2D.h"

Enumerations

enum class  eSprite : UINT {
  Background , Smoke , Ball , Crate ,
  Barrel , Base , Wheel , Clock ,
  Needle , Temperature , CurTemperature , MaxTemperature ,
  EasterEgg , Size
}
 Sprite enumerated type. More...
 
enum class  eSound : UINT {
  Thump , Cannon , Tick , Win ,
  Lose , Clang , Arr , Size
}
 Sound enumerated type. More...
 
enum  eGameState {
  Playing , Won , Lost , Size ,
  Size , Size
}
 State of game play, including whether the player has won or lost.
 

Functions

float PW2RW (float x)
 Physics World to Render World units for a float.
 
Vector2 PW2RW (const b2Vec2 &v)
 Physics World to Render World units for a vector.
 
float RW2PW (float x)
 Render World to Physics World units for a float.
 
float RW2PW (int x)
 Render World to Physics World units for an int.
 
b2Vec2 RW2PW (int x, int y)
 Render World to Physics World units for a vector provided as a pair of ints.
 
b2Vec2 RW2PW (const Vector2 &v)
 Render World to Physics World units for a vector.
 

Variables

const UINT MAXPLAYTIME = 60
 Maximum allowable playing time per level.
 
const float fPRV = 10.0f
 Physics World to Render World rescale value.
 

Detailed Description

Game specific defines.

Enumeration Type Documentation

◆ eSound

enum eSound : UINT
strong

Sound enumerated type.

An enumerated type for the sounds, which will be cast to an unsigned integer and used for the index of the corresponding sample. Size must be last.

◆ eSprite

enum eSprite : UINT
strong

Sprite enumerated type.

An enumerated type for the sprites, which will be cast to an unsigned integer and used for the index of the corresponding texture in graphics memory. Size must be last.