Compare commits
2 Commits
v0.3
...
92e406bc74
Author | SHA1 | Date | |
---|---|---|---|
92e406bc74 | |||
2d64adf476 |
11
src/main.c
11
src/main.c
@ -44,11 +44,13 @@ const char *info_format =
|
|||||||
"x: %f\n"
|
"x: %f\n"
|
||||||
"y: %f\n"
|
"y: %f\n"
|
||||||
"angle: %f (%f degrees)\n"
|
"angle: %f (%f degrees)\n"
|
||||||
"velX: %f\n"
|
"velX: %f px/sec\n"
|
||||||
"velY: %f";
|
"velY: %f px/sec";
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
printf("SpaceShipSim v%s\n", VERSION);
|
char title[32];
|
||||||
|
sprintf(title, "SpaceShipSim v%s", VERSION);
|
||||||
|
puts(title);
|
||||||
|
|
||||||
if(!al_init())
|
if(!al_init())
|
||||||
{
|
{
|
||||||
@ -79,6 +81,7 @@ int main() {
|
|||||||
fprintf(stderr, "alleg5: failed to initialize display.\n");
|
fprintf(stderr, "alleg5: failed to initialize display.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
al_set_window_title(display, title);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
puts("Created display.");
|
puts("Created display.");
|
||||||
#endif
|
#endif
|
||||||
@ -125,7 +128,7 @@ int main() {
|
|||||||
ship.x, ship.y,
|
ship.x, ship.y,
|
||||||
ship.direction,
|
ship.direction,
|
||||||
RAD_TO_DEG(ship.direction),
|
RAD_TO_DEG(ship.direction),
|
||||||
ship.velX, ship.velY);
|
ship.velX * FPS, ship.velY * FPS);
|
||||||
al_draw_multiline_text(font,
|
al_draw_multiline_text(font,
|
||||||
al_map_rgb(0xFF, 0xFF, 0xFF),
|
al_map_rgb(0xFF, 0xFF, 0xFF),
|
||||||
5, 5, WINDOW_WIDTH, 10.0f,
|
5, 5, WINDOW_WIDTH, 10.0f,
|
||||||
|
Reference in New Issue
Block a user