added README and gitignore

This commit is contained in:
2026-08-12 17:53:50 +02:00
parent 11dd73a9c4
commit 1e2f7982f6
9 changed files with 21 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
target
+10
View File
@@ -0,0 +1,10 @@
# Project
This is a classic A* implementation written in c.
The project is split into:
- `frontend`: An interactive raylib visualization
- `backend`: The independent algorithm (can be used elsewhere)
## Background
I wrote this as a prototype and copied it almost 1 to 1 into my [other projects](https://git.magnusku.de/Magnus/topdown_game) code.
+10 -1
View File
@@ -5,10 +5,19 @@
#include "../include/astar.h"
bool is_collider(int i) {
if (i == -1 || i == 10) {
return false;
}
else {
return true;
}
}
void reset_field(afield_t *field, int** map) {
for (int r = 0; r < field->rows; r++) {
for (int c = 0; c < field->columns; c++) {
bool is_obstacle = map[r][c] != -1 ? true : false;
bool is_obstacle = is_collider(map[r][c]);
field->map[r][c] = (anode_t){
.parent = {-1, -1},
BIN
View File
Binary file not shown.