Skip to content

Commit d988f93

Browse files
committed
refactor stuff to a header file
1 parent f85447f commit d988f93

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

raylib_app.c

+2-9
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ void DrawUI()
2828
DrawText("Toggle Music", playMusicPos.x + buttonWidth / 2 - MeasureText("Toggle Music", 10) / 2, playMusicPos.y + buttonHeight / 2 - 5, 11, WHITE);
2929
}
3030

31-
void DrawSnowflake(Vector2 position, float size, Color color)
32-
{
33-
DrawPoly(position, 6, size, GetRandomValue(0, 360), color);
34-
}
35-
36-
3731
int main(void)
3832
{
3933
const int screenWidth = 854;
@@ -69,8 +63,7 @@ int main(void)
6963
drops[i].position.x = GetRandomValue(0, screenWidth);
7064
}
7165
}
72-
73-
66+
7467
// user input
7568
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
7669
{
@@ -142,4 +135,4 @@ int main(void)
142135
CloseWindow();
143136

144137
return 0;
145-
}
138+
}

raylib_app.h

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
#define MAX_SIZE 10
66
#include "raylib.h"
77

8+
void DrawSnowflake(Vector2 position, float size, Color color)
9+
{
10+
DrawPoly(position, 6, size, GetRandomValue(0, 360), color);
11+
}
812

913
Color snowColor = (Color){255, 255, 255, 200};
1014
int snowDropSize = MAX_SIZE;

0 commit comments

Comments
 (0)