good progress, signals not going to next node

This commit is contained in:
Sebastian
2024-10-13 04:22:09 +02:00
parent 7b144ed3df
commit 1e7eacb893
20 changed files with 10762 additions and 118 deletions
+14 -14
View File
@@ -1,32 +1,32 @@
#pragma once
#include "SFML/Graphics/CircleShape.hpp"
#include "SFML/Graphics/Color.hpp"
#include "SFML/Graphics/RenderWindow.hpp"
#include <raylib.h>
#include "datatypes.h"
#include "moveable.h"
#include "node.h"
class Signal : public Movable{
public:
Signal();
Signal(float x, float y, float r) : Movable(Vec2D<float>(x, y), Vec2D<float>(0,0), 0.0), radius(r) {}
Signal(float x, float y, float r, float s) : Movable(Vec2D<float>(x, y), Vec2D<float>(0,0), s), radius(r) {}
int id = 0;
Node *next;
bool at_target = false;
int target_node_id = 1;
int source_node_id = 0;
float radius;
void update() { position += direction.norm() * speed;};
void draw(Vec2D<float> *mouse) {
position += direction.norm() * speed;
void draw(sf::RenderWindow *window) {
sf::CircleShape circle(radius);
circle.setFillColor(sf::Color(232, 125, 62));
circle.setPosition(position.x, position.y);
// circle.getPoint();
// circle.getPointCount()
window->draw(circle);
};
DrawCircle(position.x, position.y, radius, (Color){232, 125, 62, 255});
}
};