Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
interactable.h
Go to the documentation of this file.
1#pragma once
2
3#include <colliders.h>
4#include <vec2.h>
5#include <SDL_ttf.h>
6#include <gun.h>
7#include <UI_text.h>
8#include <app.h>
9
10#define MAX_INTERACTABLES 100
11
12extern flag hasInteraction;
26
27
28typedef struct Interactable {
30
31 int index;
32 bool active;
33 bool enabled;
35
39 SDL_Rect srcRect;
40
41 SDL_Texture* spriteTexture;
42 SDL_Texture* textTexture;
43
46 void (*callback)(void* data, int interactableIndex);
47 void* data;
49
50typedef struct HealthData {
52 char* name;
54
55typedef struct AbilityData {
56 int type;
57 char* name;
60 char* path;
62
63extern HealthData healthData[3];
64extern AbilityData abilityData[8];
67extern SDL_Texture* interactabletextures[INTERACTABLE_COUNT];
68
69int Interactable_Create(InteractableType type, Vec2 position);
70void Interactable_CreateWeapon(Gun gun, Vec2 position);
71void Interactable_CreateWeaponCrate(bool opened, Gun gun, Vec2 position);
72void Interactable_CreateLog(int logIndex, Vec2 position);
80void Interactable_Deactivate(int index);
81void Interactable_CreateHealth(Vec2 position);
Implements text rendering and management for the UI system.
This file contains the definition of the AppData struct, and the 6 main routine functions inside main...
bool flag
Definition app.h:18
Defines the collider system for collision detection.
Implements weapon systems including animations, shooting mechanics, and particle effects.
Gun
Definition gun.h:31
void Interactable_Render()
Definition interactable_render.c:6
InteractableType
Definition interactable.h:14
@ INTERACTABLE_EXIT
Definition interactable.h:18
@ INTERACTABLE_WEAPONCRATECLOSED
Definition interactable.h:16
@ INTERACTABLE_HEALTH_LARGE
Definition interactable.h:22
@ INTERACTABLE_WEAPON
Definition interactable.h:19
@ INTERACTABLE_LOG
Definition interactable.h:17
@ INTERACTABLE_WEAPONCRATEOPEN
Definition interactable.h:15
@ INTERACTABLE_HEALTH
Definition interactable.h:20
@ INTERACTABLE_HEALTH_MEDIUM
Definition interactable.h:21
@ INTERACTABLE_ABILITIES
Definition interactable.h:23
@ INTERACTABLE_COUNT
Definition interactable.h:24
#define MAX_INTERACTABLES
Definition interactable.h:10
void Interactable_RenderEndRoom()
Definition interactable_render.c:29
SDL_Texture * interactabletextures[INTERACTABLE_COUNT]
Definition interactable_start.c:5
Interactable interactables[MAX_INTERACTABLES]
Definition interactable_start.c:4
void Interactable_CreateAbilties(Vec2 position)
Definition interactable_abilities.c:5
void Interactable_CreateHealth(Vec2 position)
Definition interactable_health.c:6
void Interactable_CreateLog(int logIndex, Vec2 position)
Definition logs.c:25
void Interactable_RenderInteractionText()
Definition interactable_render.c:44
void Interactable_RenderInteractableHUD()
Definition interactable_render.c:64
void Interactable_Update()
Definition interactable_update.c:5
void Interactable_Deactivate(int index)
Definition interactable_create.c:39
UIElement * interactionText
Definition interactable_start.c:6
void Interactable_CreateWeapon(Gun gun, Vec2 position)
Definition interactable_gun.c:4
Interactable interactableData[INTERACTABLE_COUNT]
Definition interactable_data.c:6
void Interactable_Reset()
Definition interactable_create.c:24
int Interactable_Create(InteractableType type, Vec2 position)
Definition interactable_create.c:6
HealthData healthData[3]
Definition interactable_start.c:8
void Interactable_Start()
Definition interactable_start.c:74
void Interactable_CreateWeaponCrate(bool opened, Gun gun, Vec2 position)
Definition interactable_crate.c:4
AbilityData abilityData[8]
Definition interactable_start.c:14
flag hasInteraction
Definition interactable_start.c:7
Definition interactable.h:55
char * descriptionPro
Definition interactable.h:58
char * descriptionCon
Definition interactable.h:59
int type
Definition interactable.h:56
char * path
Definition interactable.h:60
char * name
Definition interactable.h:57
Definition interactable.h:50
char * name
Definition interactable.h:52
int healthAmount
Definition interactable.h:51
Definition interactable.h:28
SDL_Texture * spriteTexture
Definition interactable.h:41
char * spritePath
Definition interactable.h:44
void(* callback)(void *data, int interactableIndex)
Definition interactable.h:46
char * interactionText
Definition interactable.h:45
Vec2 hitboxSize
Definition interactable.h:38
Vec2 position
Definition interactable.h:36
void * data
Definition interactable.h:47
bool enabled
Definition interactable.h:33
bool interactable
Definition interactable.h:34
SDL_Texture * textTexture
Definition interactable.h:42
InteractableType type
Definition interactable.h:29
Vec2 renderSize
Definition interactable.h:37
int index
Definition interactable.h:31
bool active
Definition interactable.h:32
SDL_Rect srcRect
Definition interactable.h:39
UI Element structure.
Definition UI.h:55
A 2D vector structure.
Definition vec2.h:81
Provides 2D vector functionality for positions, directions, and transformations.