mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
little animation at the end of the level
This commit is contained in:
parent
a8e6000803
commit
42c8473436
3 changed files with 26 additions and 16 deletions
23
src/level.c
23
src/level.c
|
@ -290,29 +290,22 @@ void Level_Load(struct Game *game) {
|
|||
TM_AddDelay(200);
|
||||
TM_AddQueuedBackgroundAction(&Accelerate, NULL, 0, "accelerate");
|
||||
TM_AddAction(&Fly, NULL, "fly");
|
||||
/*TM_AddDelay(2*1000);*/
|
||||
TM_AddDelay(500);
|
||||
/* first part gameplay goes here */
|
||||
|
||||
/* actions for generating obstacles should go here
|
||||
* probably as regular actions. When one ends, harder one
|
||||
* begins. After last one part with muffins starts.
|
||||
* Should obstacles themselves be handled as objects
|
||||
* on timeline? (probably not). Hmm... */
|
||||
* begins. After last one part with muffins starts. */
|
||||
TM_AddAction(&GenerateObstacles, NULL, "obstacles");
|
||||
TM_AddDelay(4*1000);
|
||||
|
||||
/*
|
||||
// wings disappear, deccelerate, fall down
|
||||
// run
|
||||
// show Fluttershy's house
|
||||
TM_AddDelay(3*1000);
|
||||
/* wings disappear, deccelerate */
|
||||
TM_AddAction(&Run, NULL, "run");
|
||||
TM_AddDelay(3*1000);
|
||||
/* show Fluttershy's house
|
||||
|
||||
// second part gameplay goes here
|
||||
//
|
||||
|
||||
// cutscene goes here
|
||||
//
|
||||
*/
|
||||
|
||||
// cutscene goes here */
|
||||
TM_AddAction(&PassLevel, NULL, "passlevel");
|
||||
|
||||
struct Obstacle *obst = malloc(sizeof(struct Obstacle));
|
||||
|
|
|
@ -76,14 +76,28 @@ bool Fly(struct Game *game, struct TM_Action *action, enum TM_ActionState state)
|
|||
SelectDerpySpritesheet(game, "fly");
|
||||
/*game->level.gg = true;*/
|
||||
TM_AddBackgroundAction(&ShowMeter, NULL, 0, "showmeter");
|
||||
action->arguments++;
|
||||
}
|
||||
action->arguments++;
|
||||
game->level.derpy_y-=tps(game, 60*0.004);
|
||||
if (game->level.derpy_y>0.2) return false;
|
||||
game->level.handle_input=true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Run(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||
if (state == TM_ACTIONSTATE_INIT) action->arguments = NULL;
|
||||
if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||
if (!(action->arguments)) {
|
||||
game->level.handle_input=false;
|
||||
game->level.speed_modifier=1;
|
||||
action->arguments++;
|
||||
}
|
||||
game->level.derpy_y+=tps(game, 60*0.0042);
|
||||
if (game->level.derpy_y<0.65) return false;
|
||||
SelectDerpySpritesheet(game, "run");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||
/*float* tmp; bool* in;*/
|
||||
int* count;
|
||||
|
|
|
@ -40,6 +40,9 @@ bool ShowMeter(struct Game *game, struct TM_Action *action, enum TM_ActionState
|
|||
/*! \brief Fly Derpy, fly! */
|
||||
bool Fly(struct Game *game, struct TM_Action *action, enum TM_ActionState state);
|
||||
|
||||
/*! \brief Run Derpy, run! */
|
||||
bool Run(struct Game *game, struct TM_Action *action, enum TM_ActionState state);
|
||||
|
||||
/*! \brief Generates obstacles. */
|
||||
bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_ActionState state);
|
||||
|
||||
|
|
Loading…
Reference in a new issue