Pong in C++ – Pause Menu

I am continuing the development of Pong using Unreal Engine 4.

Minor updates

I have made some minor updates since the last time.

Moving the Paddle

I have adding a new input axis binding for the paddle. It is now possible to move it using the mouse.

Hiding the Mouse

I’ve changed the way to hide the mouse when the game starts. Now, I use SetInputMode to specify who get the mouse:

 FInputModeGameOnly InputMode;
 World->GetFirstPlayerController()->SetInputMode(InputMode);

Forward Declaration

To reduce compiling time, I now use forward declarations instead of including header files inside other header files.

Pause Menu

I have created a new Pause Menu in UMG.

PauseMenu

This menu is called from a blueprint event OnPauseRequest called when the player presses ‘P’, ‘M’ or ‘Esc’. This event is declared in PongGameMode.h

UFUNCTION(BlueprintNativeEvent, Category = “Event”)
void OnPauseRequest();

It is called in BP_1PGameMode:

PauseRequest

Version Alpha 1

This is finally the first version of Pong. It is built for Windows 32 bit desktop.

About

Gamer

Tagged with:

Leave a Reply