-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0087ab9
commit b865034
Showing
6 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
Submodule c1k3-assets
updated
9 files
+7 −0 | blend/doc/HOWTO | |
+ − | blend/map1.blend | |
+2,050 −1,265 | blend/map1.gltf | |
+ − | blend/menu.blend | |
+383 −0 | blend/menu.gltf | |
+ − | newmodels/demon.blend | |
+ − | newmodels/demon_breathe.blend | |
+ − | newmodels/demon_breathe.glb | |
+ − | newmodels/pig.glb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
#include "entity.h" | ||
#include "game.h" | ||
#include "audio.h" | ||
#include "map.h" | ||
#include "vector.h" | ||
|
||
void entity_demon_init(entity_t * e); | ||
void entity_demon_update(entity_t * e); | ||
|
||
// todo, once animations are actually parse-able | ||
animation_t demon_animations[] = { | ||
{ // 0: Idle | ||
.time = 0.5, | ||
.num_frames = 6, | ||
.frames = (animation_frame_t[]) { | ||
{.name = "default"}, | ||
{.name = "breathe.001"}, | ||
{.name = "breathe.002"}, | ||
{.name = "breathe.003"}, | ||
{.name = "breathe.004"}, | ||
{.name = "breathe.005"}, | ||
}, | ||
} | ||
}; | ||
|
||
// hack for caching parsed frame names per-map | ||
static ref_entt_t * last_ref_entt = NULL; | ||
|
||
void entity_demon_constructor(entity_t * e) { | ||
entity_constructor(e); | ||
e->_update = entity_demon_update; | ||
entity_demon_init(e); | ||
} | ||
|
||
void entity_demon_init(entity_t * e) { | ||
|
||
entity_parse_animation_frames( | ||
e->_params->entity_generic_params.ref_entt, | ||
demon_animations, | ||
sizeof(demon_animations)/sizeof(demon_animations[0]), | ||
&last_ref_entt | ||
); | ||
|
||
e->_animation_collection = (animation_collection_t) { | ||
.animations = demon_animations, | ||
.num_animations = sizeof(demon_animations)/sizeof(demon_animations[0]), | ||
}; | ||
|
||
e->_anim = &(e->_animation_collection.animations[0]); | ||
e->_anim_time = 0; | ||
|
||
entity_set_model(e); | ||
} | ||
|
||
void entity_demon_update(entity_t * e) { | ||
e->_draw_model(e); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
#ifndef ENTITY_ENEMY_DEMON_H | ||
#define ENTITY_ENEMY_DEMON_H | ||
|
||
#include "entity.h" | ||
|
||
void entity_demon_constructor(entity_t *e); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters