Created
November 7, 2020 21:07
-
-
Save Saafan/23a6567ea7f4c739dfdd02bb391a826e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool firstTime = true; | |
class Vec2 | |
{ | |
public: | |
float x = 0.0f; | |
float y = 0.0f; | |
} | |
Vec2 coinPositions[10]; | |
void Display() | |
{ | |
if(firstTime) | |
{ | |
for(int i = 0; i < 10; i++) | |
{ | |
Vec2 coinPos; | |
coinPos.x = rand() % any_number; | |
coinPos.y = rand() % any_number; | |
coinPositions[i] = coinPos; | |
} | |
firstTime = false; | |
} | |
for(int i = 0; i < 10; i++) | |
{ | |
drawCoin(coinPositions[i].x, coinPositions[i].y); | |
} | |
} | |
void drawCoin(float x, float y) | |
{ | |
// Draw coin with random X and Y values | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment