Introduction
This tutorial show how to listen to keyboard keys and move your camera. You have to read Hello Kochol Game Engine tutorial before this tutorial
The code for moving the camera
#include "../../Include/kge.h"
#pragma comment(lib, "../../bin/debug/kge.lib")
const float fCamSpeed = 3.0f;
void keys(float elaspedtime)
{
pCam->
MoveBF(fCamSpeed * elaspedtime);
pCam->
MoveBF(-fCamSpeed * elaspedtime);
pCam->
MoveRL(fCamSpeed * elaspedtime);
pCam->
MoveRL(-fCamSpeed * elaspedtime);
}
int main()
{
(
);
for (int j =0; j < 25; j++)
{
for (int i = 0; i < 25; i++)
{
if (i % 2 == 0)
else
}
}
{
keys(fElaspedTime);
}
}