comments mostly

This commit is contained in:
Tobin
2026-04-25 14:46:52 -04:00
parent 6bd50b041c
commit d46a436303
3 changed files with 28 additions and 7 deletions
+16 -6
View File
@@ -1,6 +1,12 @@
#include "cat_api.h"
#include <time.h>
/* TODO:
- *forces* as linked list struct? entity can have a list of forces acting on it
if force is 0N cleanup remove from list every tick.
or every few ticks do a cleanup routine that also frees memory and stuff
*/
void bye(void)
{
printf("bye!\n");
@@ -60,13 +66,14 @@ struct entity
{
int is_player;
int is_static;
int x;
int y;
int width;
int height;
int in_freefall;
float x;
float y;
int width; /**/
int height; /**/
unsigned char r; /* replace this with sprite TODO */
unsigned char g;
unsigned char b;
unsigned char g; /**/
unsigned char b; /**/
float vx;
float vy;
float ax;
@@ -212,6 +219,8 @@ void apply_friction(void) /* FIXME */
else if (p->vy < 0) p->vy += 1;
}
/* FIXME */ static int tick_count = 0;
void tick(void)
{
/* run every N milliseconds... nanoseconds? idk */
@@ -224,6 +233,7 @@ void tick(void)
/* do a tick */
yes: last_sec = t.tv_sec;
last_nsec = t.tv_nsec;
printf("tick %d!\n", tick_count++);
/* code to run every tick goes here */
erase_entities();