Yume Project 3.0
Touhou-inspired Danmaku game made in C only
Chargement...
Recherche...
Aucune correspondance
common_task.h
Aller à la documentation de ce fichier.
1
10
11#pragma once
12
13#include "assets.h"
14#include "bullet.h"
15#include "coroutine/tasks.h"
16#include "cotask.h"
17#include "hud.h"
18#include "moonlight_bg.h"
19#include "obj.h"
20#include "player.h"
21#include "macro.h"
22#include "game_state.h"
23#include "pool.h"
24#include <raylib.h>
25
26DECLARE_EXTERN_TASK(phase_timer, { CoEvent *event; int duration; });
27
28DECLARE_EXTERN_TASK(obj_GoTo, {Pool *pool; Entity objId; float x; float y; float speed;});
29
30DECLARE_EXTERN_TASK(play_anim_once, {Pool *pool; float x; float y; float scaleX; float scaleY; int sprite_id; float alpha; });
31
32DECLARE_EXTERN_TASK(boss_orb_effect, {Pool *pool; Entity boss; });
33DECLARE_EXTERN_TASK(boss_pentagram_effect, {Pool *pool; Entity boss; });
34DECLARE_EXTERN_TASK(boss_particle_spawner, {Pool *pool; Entity boss; });
35DECLARE_EXTERN_TASK(boss_distortion_effect, {Pool *pool; Entity boss; Vector2 *lens_center; float *lens_radius; float *lens_strength;});
36
37DECLARE_EXTERN_TASK(orb_explosion, {Pool *pool; float x; float y;});
38
39DECLARE_EXTERN_TASK(orb_explosion_big, {Pool *pool; float x; float y;});
40
41DECLARE_EXTERN_TASK(spellcard_bg_anim, {Pool *pool; int duration; });
42DECLARE_EXTERN_TASK(start_spellcard_sequence, {Pool *pool; Entity boss; const char* spell_name; int duration; });
43
44#define RUN_SPELLCARD_W(ctx, pool, boss, spell, var, spell_name, life) \
45 obj_SetMaxLife(pool, boss, life); \
46 obj_SetLife(pool, boss, life); \
47 INVOKE_SUBTASK(start_spellcard_sequence, pool, boss, spell_name, 120); \
48 WAIT(120); \
49 CoTask* MACRO_CONCAT(task_, var) = spell; \
50 BoxedTask MACRO_CONCAT(box_, var) = cotask_box(MACRO_CONCAT(task_, var)); \
51 \
52 while(!obj_IsDead(pool, boss)) { \
53 YIELD; \
54 } \
55\
56 HUD_clear_spellcard(); \
57 CANCEL_TASK(MACRO_CONCAT(box_, var)); \
58 Bullet_clear_bullets(ctx); \
59 moonlight_bg_set_mode(false);
60#define RUN_SPELLCARD(ctx, boss, spell, spell_name, life) RUN_SPELLCARD_W(ctx, (ctx)->pool, boss, spell, MACRO_ADDLINENUM(boss), spell_name, life)
61
62#define RUN_NONSPELL_W(ctx, pool, boss, nonspell, var, life) \
63 moonlight_bg_set_mode(false); \
64 obj_SetMaxLife(pool, boss, life); \
65 obj_SetLife(pool, boss, life); \
66 obj_AddFlag(pool, boss, FLAG_INVINCIBLE); \
67 WAIT(120); \
68 obj_RemoveFlag(pool, boss, FLAG_INVINCIBLE); \
69 CoTask* MACRO_CONCAT(task_, var) = nonspell; \
70 BoxedTask MACRO_CONCAT(box_, var) = cotask_box(MACRO_CONCAT(task_, var)); \
71 while(!obj_IsDead(pool, boss)) { \
72 YIELD; \
73 } \
74 CANCEL_TASK(MACRO_CONCAT(box_, var)); \
75 Bullet_clear_bullets(ctx);
76#define RUN_NONSPELL(ctx, boss, nonspell, life) RUN_NONSPELL_W(ctx, (ctx)->pool, boss, nonspell, MACRO_ADDLINENUM(boss), life)
77
78DECLARE_EXTERN_TASK(Bullet_spawn_accel, {Pool *p; Entity bullet; float speed;
79 float accel; int accel_delay; });
Chargement et références des assets (textures, sprites, audio, polices).
Fonctions qui permettent de tirer des bullets de différentes manières.
uint32_t Entity
Une entité est un indice.
Definition ecs.h:20
Fonctions permettant de gêrer l'état du programme.
Système d'affichage du HUD (Heads-Up Display).
Arrière-plan et effets pour le stage "moonlight".
Gestion du joueur : structures Player, Weapon.
Definition coevent.h:14
La pool est la structure qui contient l'Entity Component System Elle gêre les différentes composantes...
Definition pool.h:42
#define DECLARE_EXTERN_TASK(name,...)
Definition tasks.h:143