Skip to content

Instantly share code, notes, and snippets.

@sknjpn
Created March 15, 2020 06:46
Show Gist options
  • Save sknjpn/c871d74493dd42f44c410eddf17c1673 to your computer and use it in GitHub Desktop.
Save sknjpn/c871d74493dd42f44c410eddf17c1673 to your computer and use it in GitHub Desktop.
class Ball
{
bool enabled = false;
Vec2 position;
}
Ball balls[100];
void update()
{
}
void addNewBall(Vec2 position)
{
for(int i=0;i<100;++i)
{
if(!balls[i].enabled)
{
balls[i].enabled = true;
balls[i].position = position;
return;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment