feat: Initial Commit

This commit is contained in:
Tristan Russell 2025-06-05 08:14:04 -04:00
commit c0c417369e
Signed by: tristanr
GPG Key ID: 4495C92911DF04CA
5 changed files with 51 additions and 0 deletions

20
dudes.c Normal file
View File

@ -0,0 +1,20 @@
#include <stdlib.h>
#include "dudes.h"
struct dude* makeDude() {
struct dude* d = malloc(sizeof(struct dude));
d->hp = 100;
d->mp = 70;
d->atk = 5;
d->def = 2;
for(int i = 0; i < 10; i++) {
d->spells[i] = NULL;
}
return d;
}
void destroyDude(struct dude* d) {
free(d);
}

11
dudes.h Normal file
View File

@ -0,0 +1,11 @@
struct dude {
int hp;
int mp;
int atk;
int def;
void* spells[10];
};
struct dude* makeDude();
void destoryDude();

15
main.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdio.h>
#include "dudes.h"
int main() {
int done = 0;
struct dude* player = makeDude();
struct dude* enemy = makeDude();
while(done == 0) {
printf("STATUS HP %i MP %i\n", player->hp, player->mp);
printf("ENEMY HP %i MP %i\n", enemy->hp, enemy->mp);
done = 1;
}
return 0;
}

2
makefile Normal file
View File

@ -0,0 +1,2 @@
main:
gcc main.c dudes.c

3
spells.c Normal file
View File

@ -0,0 +1,3 @@
struct heal {
};