feat: add trail

This commit is contained in:
2025-11-15 18:29:46 +01:00
parent 90ee367dc6
commit 89fe0e0f65
5 changed files with 107 additions and 64 deletions

View File

@@ -1,14 +1,26 @@
#ifndef SIMS_HPP
#define SIMS_HPP
#include <SDL3/SDL_render.h>
#define SIMS_HPP
namespace sims {
typedef struct {
int x;
int y;
int r;
} body;
void two_bodies(SDL_Renderer *r);
}
#include <SDL3/SDL_render.h>
#include <utility>
class Body {
private:
float x;
float y;
float vx = 1;
float vy = 1;
std::pair<float, float> old_positions[100];
public:
SDL_Renderer* renderer;
Body(int x_pos, int y_pos);
void draw_tail();
void live();
};
void two_bodies(SDL_Renderer* r, Body &a, Body &b);
#endif