You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
830 B
44 lines
830 B
#define OLC_PGE_APPLICATION
|
|
#include <iostream>
|
|
#include "pixelGameEngine.h" // use this for drawing stuff to screen
|
|
|
|
using namespace olc;
|
|
|
|
class BallGame : public olc::PixelGameEngine
|
|
{
|
|
public:
|
|
BallGame()
|
|
{
|
|
sAppName = "Example";
|
|
}
|
|
|
|
public:
|
|
|
|
bool OnUserCreate() override
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool OnUserUpdate(float fElapsedTime) override
|
|
{
|
|
for (int i=0;i<ScreenWidth();i++) {
|
|
for (int j=0;j<ScreenHeight();j++) {
|
|
Draw({i,j},Pixel(rand()%255,rand()%255,rand()%255));
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
int main()
|
|
{
|
|
BallGame game;
|
|
if (game.Construct(256, 240, 4, 4))
|
|
game.Start();
|
|
|
|
return 0;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
// END OF FILE
|
|
//--------------------------------------------------------------------------------------------------
|