comments mostly
This commit is contained in:
@@ -1 +1 @@
|
|||||||
https://www.beepbox.co/#9n31sbk0l00e05t1-a7g0fj07r4i0o432T1v1u61f0qwx10v311d08A5F2B6Q0530Pf636E2b677T5v1u53f0qwx10h511d03H_RIBJAAAzrrrqhh0E1b4T1v1ue7f10p7q0331d08A0F5B3Q0140Pea77E361b627638T2v1u15f10w4qw02d03w0E0b4id50000000id3g00000018Qd00000004h400000000p22PAqq_7jhWttlh7llCoyCnC0Pif0E7uOaWaYyl8Y2O-mJPs1FEIP4SnXNk0CLXFEY1vtjhjnrAkY9W3w5uVytdtOq3CG0JI2Q4L5Pq-HdE8kxAh26kUxMgx2I4894gxA127rEW14S135L46OJz84kqh45w11wFJvlglYDHlRO6Bl0MeJnpk00
|
https://www.beepbox.co/#9n31sbk0l00e05t1-a7g0fj07r4i0o432T1v1u61f0qwx10v311d08A5F2B6Q0530Pf636E2b677T5v1u53f0qwx10h511d03H_RIBJAAAzrrrqhh0E1b4T1v1ue7f10p7q0331d08A0F5B3Q0140Pea77E361b627638T2v1u15f10w4qw02d03w0E0b5yd50000000id3g00000018Qd00000004h400000000p236Aqq_7jhWttlh7llCoCCnKLc8Zq2SYyKyL8B2f0sLBHsT0GqbcNdB-Yl09H-Wqf0nTkQkRSV5f2uwU1nKoDjnsCwVGwbr0J1bV7jKg5lh7llwe8sP0pF6ndHWISwxi6h48pjy7124aMgwAh26g48tKzE4jo4cmYgraScwhhF4gm0462CRZl1nOuJnn8qlk30WRtBg00
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
/* yields
|
||||||
|
cat_init();
|
||||||
|
cat_create_window();
|
||||||
|
cat_pixel();
|
||||||
|
cat_fill();
|
||||||
|
cat_render();
|
||||||
|
cat_play_wav();
|
||||||
|
cat_stop_audio();
|
||||||
|
cat_get_event();
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
#include "cat_api.h"
|
#include "cat_api.h"
|
||||||
#include <time.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)
|
void bye(void)
|
||||||
{
|
{
|
||||||
printf("bye!\n");
|
printf("bye!\n");
|
||||||
@@ -60,13 +66,14 @@ struct entity
|
|||||||
{
|
{
|
||||||
int is_player;
|
int is_player;
|
||||||
int is_static;
|
int is_static;
|
||||||
int x;
|
int in_freefall;
|
||||||
int y;
|
float x;
|
||||||
int width;
|
float y;
|
||||||
int height;
|
int width; /**/
|
||||||
|
int height; /**/
|
||||||
unsigned char r; /* replace this with sprite TODO */
|
unsigned char r; /* replace this with sprite TODO */
|
||||||
unsigned char g;
|
unsigned char g; /**/
|
||||||
unsigned char b;
|
unsigned char b; /**/
|
||||||
float vx;
|
float vx;
|
||||||
float vy;
|
float vy;
|
||||||
float ax;
|
float ax;
|
||||||
@@ -212,6 +219,8 @@ void apply_friction(void) /* FIXME */
|
|||||||
else if (p->vy < 0) p->vy += 1;
|
else if (p->vy < 0) p->vy += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME */ static int tick_count = 0;
|
||||||
|
|
||||||
void tick(void)
|
void tick(void)
|
||||||
{
|
{
|
||||||
/* run every N milliseconds... nanoseconds? idk */
|
/* run every N milliseconds... nanoseconds? idk */
|
||||||
@@ -224,6 +233,7 @@ void tick(void)
|
|||||||
/* do a tick */
|
/* do a tick */
|
||||||
yes: last_sec = t.tv_sec;
|
yes: last_sec = t.tv_sec;
|
||||||
last_nsec = t.tv_nsec;
|
last_nsec = t.tv_nsec;
|
||||||
|
printf("tick %d!\n", tick_count++);
|
||||||
|
|
||||||
/* code to run every tick goes here */
|
/* code to run every tick goes here */
|
||||||
erase_entities();
|
erase_entities();
|
||||||
|
|||||||
Reference in New Issue
Block a user