mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
bring back level 2 with its moonwalk
This commit is contained in:
parent
840202f758
commit
91d3bb0d59
7 changed files with 254 additions and 92 deletions
|
@ -53,6 +53,29 @@ void SelectSpritesheet(struct Game *game, struct Character *character, char* nam
|
|||
return;
|
||||
}
|
||||
|
||||
void LoadSpritesheets(struct Game *game, struct Character *character) {
|
||||
PrintConsole(game, "Loading spritesheets for character %s...", character->name);
|
||||
struct Spritesheet *tmp = character->spritesheets;
|
||||
while (tmp) {
|
||||
if (!tmp->bitmap) {
|
||||
char filename[255] = { };
|
||||
snprintf(filename, 255, "levels/%s/%s.png", character->name, tmp->name);
|
||||
tmp->bitmap = LoadScaledBitmap(game, filename, (int)(game->viewport.height*0.25*tmp->aspect*tmp->scale)*tmp->cols, (int)(game->viewport.height*0.25*tmp->scale)*tmp->rows);
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
void UnloadSpritesheets(struct Game *game, struct Character *character) {
|
||||
PrintConsole(game, "Unloading spritesheets for character %s...", character->name);
|
||||
struct Spritesheet *tmp = character->spritesheets;
|
||||
while (tmp) {
|
||||
if (tmp->bitmap) al_destroy_bitmap(tmp->bitmap);
|
||||
tmp->bitmap = NULL;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterSpritesheet(struct Game *game, struct Character *character, char* name) {
|
||||
struct Spritesheet *s = character->spritesheets;
|
||||
while (s) {
|
||||
|
@ -86,6 +109,66 @@ void RegisterSpritesheet(struct Game *game, struct Character *character, char* n
|
|||
al_destroy_config(config);
|
||||
}
|
||||
|
||||
struct Character* CreateCharacter(struct Game *game, char* name) {
|
||||
PrintConsole(game, "Creating character %s...", name);
|
||||
struct Character *character = malloc(sizeof(struct Character));
|
||||
character->name = strdup(name);
|
||||
character->angle = 0;
|
||||
character->bitmap = NULL;
|
||||
character->data = NULL;
|
||||
character->pos = 0;
|
||||
character->pos_tmp = 0;
|
||||
character->x = -1;
|
||||
character->y = -1;
|
||||
character->spritesheets = NULL;
|
||||
character->spritesheet = NULL;
|
||||
return character;
|
||||
}
|
||||
|
||||
void DestroyCharacter(struct Game *game, struct Character *character) {
|
||||
PrintConsole(game, "Destroying character %s...", character->name);
|
||||
UnloadSpritesheets(game, character);
|
||||
struct Spritesheet *tmp, *s = character->spritesheets;
|
||||
tmp = s;
|
||||
while (s) {
|
||||
tmp = s;
|
||||
s = s->next;
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
if (character->bitmap) al_destroy_bitmap(character->bitmap);
|
||||
free(character->name);
|
||||
free(character);
|
||||
}
|
||||
|
||||
void AnimateCharacter(struct Game *game, struct Character *character, float speed_modifier) {
|
||||
if ((character->spritesheet->speed) && (speed_modifier)) {
|
||||
character->pos_tmp+=character->spritesheet->speed*speed_modifier;
|
||||
while (character->pos_tmp >= 1) {
|
||||
character->pos++;
|
||||
character->pos_tmp--;
|
||||
}
|
||||
if (character->pos>=character->spritesheet->cols*character->spritesheet->rows-character->spritesheet->blanks) {
|
||||
character->pos=0;
|
||||
if (character->spritesheet->successor) {
|
||||
SelectSpritesheet(game, character, character->spritesheet->successor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCharacter(struct Game *game, struct Character *character, float x, float y, float angle) {
|
||||
character->x += x;
|
||||
character->y += y;
|
||||
character->angle += angle;
|
||||
}
|
||||
|
||||
void SetCharacterPosition(struct Game *game, struct Character *character, float x, float y, float angle) {
|
||||
character->x = x;
|
||||
character->y = y;
|
||||
character->angle = angle;
|
||||
}
|
||||
|
||||
void AdvanceLevel(struct Game *game, int current_level, bool last) {
|
||||
if (last) {
|
||||
int available = atoi(GetConfigOptionDefault(game, "MuffinAttack", "level", "1"));
|
||||
|
@ -101,6 +184,28 @@ void AdvanceLevel(struct Game *game, int current_level, bool last) {
|
|||
SetConfigOption(game, "MuffinAttack", "completed", "1");
|
||||
}
|
||||
}
|
||||
|
||||
/*char* GetLevelFilename(struct Game *game, char* filename) {
|
||||
// FIXME: it should work with larger numbers too
|
||||
char* name = strdup(filename);
|
||||
char* ch = strchr(name, '?');
|
||||
ch[0] = '0' + game->level.current_level;
|
||||
return name;
|
||||
}*/
|
||||
|
||||
void DrawCharacter(struct Game *game, struct Character *character, int flags) {
|
||||
// TODO: support for additional states, like being hit (transparency, color tilt etc.)
|
||||
bool colision = false;
|
||||
|
||||
al_set_target_bitmap(character->bitmap);
|
||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
||||
al_draw_bitmap_region(character->spritesheet->bitmap, al_get_bitmap_width(character->bitmap)*(character->pos%character->spritesheet->cols),al_get_bitmap_height(character->bitmap)*(character->pos/character->spritesheet->cols),al_get_bitmap_width(character->bitmap), al_get_bitmap_height(character->bitmap),0,0,0);
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
|
||||
al_draw_tinted_rotated_bitmap(character->bitmap, al_map_rgba(255,255-colision*255,255-colision*255,255), al_get_bitmap_width(character->bitmap), al_get_bitmap_height(character->bitmap)/2, character->x*game->viewport.width + game->viewport.width*0.1953125, character->y*game->viewport.height + al_get_bitmap_height(character->bitmap)/2, character->angle, flags); // FIXME: viewport height? omg character should have its dimensions ;_;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
void Level_Logic(struct Game *game) {
|
||||
LEVELS(Logic, game);
|
||||
|
@ -224,14 +329,6 @@ void Level_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
|||
TM_HandleEvent(ev);
|
||||
}
|
||||
|
||||
char* GetLevelFilename(struct Game *game, char* filename) {
|
||||
// FIXME: it should work with larger numbers too
|
||||
char* name = strdup(filename);
|
||||
char* ch = strchr(name, '?');
|
||||
ch[0] = '0' + game->level.current_level;
|
||||
return name;
|
||||
}
|
||||
|
||||
void Level_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
PrintConsole(game, "Initializing level %d...", game->level.input.current_level);
|
||||
|
||||
|
|
|
@ -42,8 +42,9 @@ struct Character {
|
|||
struct Spritesheet *spritesheets; /*!< List of all spritesheets registered to character. */
|
||||
ALLEGRO_BITMAP* bitmap;
|
||||
int pos; /*!< Current spritesheet position. */
|
||||
float x; /*!< Horizontal position of character (0-1). */
|
||||
float y; /*!< Vertical position of character (0-1). */
|
||||
float pos_tmp; /*!< A counter used to slow down spritesheet animation. */
|
||||
float x; /*!< Horizontal position of character (0 - left, 1 - right side of maximal square). */
|
||||
float y; /*!< Vertical position of character (0 - top, 1 - bottom). */
|
||||
float angle; /*!< Characters display angle (radians). */
|
||||
void* data; /*!< Additional, custom character data (HP etc.). */
|
||||
};
|
||||
|
@ -55,8 +56,17 @@ void AdvanceLevel(struct Game *game, int current_level, bool last);
|
|||
/*! \brief Replaces first '?' char in filename with current level number. */
|
||||
char* GetLevelFilename(struct Game *game, char* filename);
|
||||
|
||||
void DrawCharacter(struct Game *game, struct Character *character);
|
||||
void DrawCharacter(struct Game *game, struct Character *character, int flags);
|
||||
|
||||
struct Character* CreateCharacter(struct Game *game, char* name);
|
||||
void DestroyCharacter(struct Game *game, struct Character *character);
|
||||
|
||||
void LoadSpritesheets(struct Game *game, struct Character *character);
|
||||
void UnloadSpritesheets(struct Game *game, struct Character *character);
|
||||
|
||||
void AnimateCharacter(struct Game *game, struct Character *character, float speed_modifier);
|
||||
void MoveCharacter(struct Game *game, struct Character *character, float x, float y, float angle);
|
||||
void SetCharacterPosition(struct Game *game, struct Character *character, float x, float y, float angle);
|
||||
|
||||
/*void Level_Passed(struct Game *game);
|
||||
void Level_Pause(struct Game *game);
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <allegro5/allegro_primitives.h>
|
||||
#include "../utils.h"
|
||||
#include "../gamestate.h"
|
||||
#include "../gamestates/level.h"
|
||||
#include "actions.h"
|
||||
|
||||
bool LevelFailed(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||
|
@ -160,6 +161,13 @@ bool Welcome(struct Game *game, struct TM_Action *action, enum TM_ActionState st
|
|||
|
||||
bool PassLevel(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||
if (state == TM_ACTIONSTATE_DESTROY) {
|
||||
if (*((int*)action->arguments->next->value) < 6) {
|
||||
AdvanceLevel(game, *((int*)action->arguments->next->value), false);
|
||||
SwitchGamestate(game, (char*)action->arguments->value, "map");
|
||||
} else {
|
||||
AdvanceLevel(game, *((int*)action->arguments->next->value), true);
|
||||
SwitchGamestate(game, (char*)action->arguments->value, "about");
|
||||
}
|
||||
//FIXME: data
|
||||
/*Level_Passed(game);
|
||||
Level_Unload(game);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "modules/moonwalk.h"
|
||||
|
@ -25,45 +26,48 @@
|
|||
#include "actions.h"
|
||||
#include "level2.h"
|
||||
|
||||
void Gamestate_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
TM_Init(game);
|
||||
TM_AddAction(&DoMoonwalk, NULL, "moonwalk");
|
||||
TM_AddAction(&PassLevel, NULL, "passlevel");
|
||||
//FadeGameState(game, true);
|
||||
|
||||
void* Gamestate_Load(struct Game *game, void (*progress)(struct Game*)) {
|
||||
|
||||
struct Level2Resources *data = malloc(sizeof(struct Level2Resources));
|
||||
data->moonwalk = Moonwalk_Load(game, 2);
|
||||
struct TM_Arguments *args = TM_AddToArgs(NULL, strdup("level2"));
|
||||
int* level = malloc(sizeof(int));
|
||||
*level=2;
|
||||
TM_AddToArgs(args, level);
|
||||
TM_AddAction(&PassLevel, args, "passlevel");
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void Gamestate_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
|
||||
void Gamestate_Unload(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Unload(game, data->moonwalk);
|
||||
free(data);
|
||||
}
|
||||
|
||||
void Gamestate_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
void Gamestate_Start(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Start(game, data->moonwalk);
|
||||
}
|
||||
|
||||
void Gamestate_Start(struct Game *game) {
|
||||
Moonwalk_Start(game);
|
||||
void Gamestate_Stop(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Stop(game, data->moonwalk);
|
||||
}
|
||||
|
||||
void Gamestate_Stop(struct Game *game) {
|
||||
Moonwalk_Stop(game);
|
||||
void Gamestate_Draw(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Draw(game, data->moonwalk);
|
||||
al_draw_textf(game->_priv.font, al_map_rgb(255,255,255), game->viewport.width/2, game->viewport.height/2.2, ALLEGRO_ALIGN_CENTRE, "Level %d: Not implemented yet!", 2);
|
||||
al_draw_text(game->_priv.font, al_map_rgb(255,255,255), game->viewport.width/2, game->viewport.height/1.8, ALLEGRO_ALIGN_CENTRE, "Have some moonwalk instead.");
|
||||
// FIXME: _priv... please fix me :/
|
||||
|
||||
}
|
||||
|
||||
void Gamestate_LoadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level2_PreloadSteps());
|
||||
Moonwalk_LoadBitmaps(game, progress);
|
||||
void Gamestate_Logic(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Logic(game, data->moonwalk);
|
||||
}
|
||||
|
||||
void Gamestate_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Gamestate_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Gamestate_ProcessEvent(struct Game *game, void* data, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
void Gamestate_ProcessEvent(struct Game *game, struct Level2Resources* data, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, data->moonwalk, ev);
|
||||
if (ev->type == ALLEGRO_EVENT_KEY_DOWN) {
|
||||
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
||||
SwitchGamestate(game, "level2", "menu");
|
||||
|
@ -71,14 +75,14 @@ void Gamestate_ProcessEvent(struct Game *game, void* data, ALLEGRO_EVENT *ev) {
|
|||
}
|
||||
}
|
||||
|
||||
void Gamestate_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
void Gamestate_Resume(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Resume(game, data->moonwalk);
|
||||
}
|
||||
|
||||
void Gamestate_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
void Gamestate_Pause(struct Game *game, struct Level2Resources* data) {
|
||||
Moonwalk_Pause(game, data->moonwalk);
|
||||
}
|
||||
|
||||
void Gamestate_Reload(struct Game *game) {}
|
||||
void Gamestate_Reload(struct Game *game, struct Level2Resources* data) {}
|
||||
|
||||
int Gamestate_ProgressCount = 0;
|
||||
|
|
|
@ -19,3 +19,8 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
struct Moonwalk;
|
||||
struct Level2Resources {
|
||||
struct Moonwalk *moonwalk;
|
||||
};
|
||||
|
|
|
@ -21,61 +21,91 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "../../gamestates/level.h"
|
||||
#include "../../utils.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
// TODO: use Walk action instead
|
||||
bool DoMoonwalk(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||
struct Character *derpy = action->arguments->value;
|
||||
if (state == TM_ACTIONSTATE_START) {
|
||||
//SelectDerpySpritesheet(game, "walk");
|
||||
//game->level.sheet_speed_modifier = 0.94;
|
||||
//game->level.moonwalk.derpy_pos = -0.2;
|
||||
SelectSpritesheet(game, derpy, "walk");
|
||||
SetCharacterPosition(game, derpy, -0.2, 0.71, 0);
|
||||
}
|
||||
else if (state == TM_ACTIONSTATE_RUNNING) {
|
||||
//game->level.moonwalk.derpy_pos=game->level.moonwalk.derpy_pos+0.00092;
|
||||
//if (game->level.moonwalk.derpy_pos>1) {
|
||||
MoveCharacter(game, derpy, 0.0009 , 0, 0);
|
||||
AnimateCharacter(game, derpy, 0.97);
|
||||
if (derpy->x > 1) { // FIXME: getter
|
||||
return true;
|
||||
//}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Moonwalk_Logic(struct Game *game) {}
|
||||
|
||||
void Moonwalk_Draw(struct Game *game) {
|
||||
/* al_set_target_bitmap(game->level.derpy);
|
||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
||||
al_draw_bitmap_region(*(game->level.derpy_sheet),al_get_bitmap_width(game->level.derpy)*(game->level.sheet_pos%6),al_get_bitmap_height(game->level.derpy)*(game->level.sheet_pos/6),al_get_bitmap_width(game->level.derpy), al_get_bitmap_height(game->level.derpy),0,0,0);
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
|
||||
al_draw_scaled_bitmap(game->level.stage,0,0,al_get_bitmap_width(game->level.stage),al_get_bitmap_height(game->level.stage),0,0,game->viewport.width, game->viewport.height,0);
|
||||
al_draw_bitmap(game->level.derpy, game->level.moonwalk.derpy_pos*game->viewport.width, game->viewport.height*0.95-al_get_bitmap_height(game->level.derpy), ALLEGRO_FLIP_HORIZONTAL);
|
||||
al_draw_textf(game->font, al_map_rgb(255,255,255), game->viewport.width/2, game->viewport.height/2.2, ALLEGRO_ALIGN_CENTRE, "Level %d: Not implemented yet!", game->level.current_level);
|
||||
al_draw_text(game->font, al_map_rgb(255,255,255), game->viewport.width/2, game->viewport.height/1.8, ALLEGRO_ALIGN_CENTRE, "Have some moonwalk instead.");*/
|
||||
void Moonwalk_Logic(struct Game *game, struct Moonwalk *data) {
|
||||
TM_Process();
|
||||
}
|
||||
|
||||
void Moonwalk_Start(struct Game *game) {
|
||||
/*game->level.moonwalk.derpy_pos = 0;
|
||||
al_play_sample_instance(game->level.music);*/
|
||||
void Moonwalk_Draw(struct Game *game, struct Moonwalk *data) {
|
||||
al_draw_scaled_bitmap(data->background,0,0,al_get_bitmap_width(data->background),al_get_bitmap_height(data->background),0,0,game->viewport.width, game->viewport.height, 0);
|
||||
DrawCharacter(game, data->derpy, ALLEGRO_FLIP_HORIZONTAL);
|
||||
}
|
||||
|
||||
void Moonwalk_LoadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
// nasty hack: overwrite level background
|
||||
/*al_destroy_bitmap(game->level.stage);
|
||||
game->level.stage = LoadScaledBitmap("levels/moonwalk/disco.jpg", game->viewport.width, game->viewport.height);
|
||||
*/
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
void Moonwalk_Start(struct Game *game, struct Moonwalk *data) {
|
||||
SelectSpritesheet(game, data->derpy, "walk");
|
||||
al_play_sample_instance(data->music);
|
||||
}
|
||||
|
||||
void Moonwalk_Load(struct Game *game) {
|
||||
//RegisterSpritesheet(game, DERPY, "walk");
|
||||
// nasty hack: overwrite level music
|
||||
//al_destroy_sample(game->level.sample);
|
||||
//game->level.sample = al_load_sample( GetDataFilePath("levels/moonwalk/moonwalk.flac") );
|
||||
|
||||
void load_bitmaps(struct Game *game, struct Moonwalk *data) {
|
||||
data->background = LoadScaledBitmap(game, "levels/moonwalk/disco.jpg", game->viewport.width, game->viewport.height);
|
||||
LoadSpritesheets(game, data->derpy);
|
||||
}
|
||||
|
||||
void Moonwalk_UnloadBitmaps(struct Game *game) {}
|
||||
void Moonwalk_Stop(struct Game *game) {}
|
||||
void Moonwalk_Unload(struct Game *game) {}
|
||||
void Moonwalk_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {}
|
||||
void Moonwalk_Resume(struct Game *game) {}
|
||||
void Moonwalk_Pause(struct Game *game) {}
|
||||
|
||||
void unload_bitmaps(struct Game *game, struct Moonwalk *data) {
|
||||
UnloadSpritesheets(game, data->derpy);
|
||||
al_destroy_bitmap(data->background);
|
||||
}
|
||||
|
||||
struct Moonwalk* Moonwalk_Load(struct Game *game, int current_level) {
|
||||
struct Moonwalk *data = malloc(sizeof(struct Moonwalk));
|
||||
|
||||
data->derpy = CreateCharacter(game, "derpy");
|
||||
|
||||
RegisterSpritesheet(game, data->derpy, "walk");
|
||||
|
||||
data->current_level = current_level;
|
||||
|
||||
load_bitmaps(game, data);
|
||||
|
||||
data->sample = al_load_sample( GetDataFilePath(game, "levels/moonwalk/moonwalk.flac") );
|
||||
|
||||
data->music = al_create_sample_instance(data->sample);
|
||||
al_attach_sample_instance_to_mixer(data->music, game->audio.music);
|
||||
al_set_sample_instance_playmode(data->music, ALLEGRO_PLAYMODE_LOOP);
|
||||
|
||||
|
||||
TM_Init(game);
|
||||
TM_AddAction(&DoMoonwalk, TM_AddToArgs(NULL, data->derpy), "moonwalk");
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void Moonwalk_Stop(struct Game *game, struct Moonwalk *data) {
|
||||
al_set_sample_instance_playing(data->music, false);
|
||||
}
|
||||
|
||||
void Moonwalk_Unload(struct Game *game, struct Moonwalk *data) {
|
||||
unload_bitmaps(game, data);
|
||||
DestroyCharacter(game, data->derpy);
|
||||
free(data);
|
||||
TM_Destroy();
|
||||
}
|
||||
void Moonwalk_ProcessEvent(struct Game *game, struct Moonwalk *data, ALLEGRO_EVENT *ev) {}
|
||||
void Moonwalk_Resume(struct Game *game, struct Moonwalk *data) {}
|
||||
void Moonwalk_Pause(struct Game *game, struct Moonwalk *data) {}
|
||||
|
||||
void Moonwalk_Reload(struct Game *game, struct Moonwalk *data) {
|
||||
unload_bitmaps(game, data);
|
||||
load_bitmaps(game, data);
|
||||
}
|
||||
|
|
|
@ -21,15 +21,23 @@
|
|||
#include "../../main.h"
|
||||
#include "../../timeline.h"
|
||||
|
||||
struct Moonwalk {
|
||||
struct Character *derpy;
|
||||
int current_level;
|
||||
ALLEGRO_BITMAP *background;
|
||||
ALLEGRO_SAMPLE *sample;
|
||||
ALLEGRO_SAMPLE_INSTANCE *music;
|
||||
};
|
||||
|
||||
bool DoMoonwalk(struct Game *game, struct TM_Action *action, enum TM_ActionState state);
|
||||
void Moonwalk_Draw(struct Game *game);
|
||||
void Moonwalk_Logic(struct Game *game);
|
||||
void Moonwalk_Start(struct Game *game);
|
||||
void Moonwalk_Stop(struct Game *game);
|
||||
void Moonwalk_Unload(struct Game *game);
|
||||
void Moonwalk_Load(struct Game *game);
|
||||
void Moonwalk_UnloadBitmaps(struct Game *game);
|
||||
void Moonwalk_LoadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
void Moonwalk_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Moonwalk_Resume(struct Game *game);
|
||||
void Moonwalk_Pause(struct Game *game);
|
||||
void Moonwalk_Draw(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_Logic(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_Start(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_Stop(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_Unload(struct Game *game, struct Moonwalk *data);
|
||||
struct Moonwalk* Moonwalk_Load(struct Game *game, int current_level);
|
||||
void Moonwalk_UnloadBitmaps(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_LoadBitmaps(struct Game *game, struct Moonwalk *data, void (*progress)(struct Game*, float));
|
||||
void Moonwalk_ProcessEvent(struct Game *game, struct Moonwalk *data, ALLEGRO_EVENT *ev);
|
||||
void Moonwalk_Resume(struct Game *game, struct Moonwalk *data);
|
||||
void Moonwalk_Pause(struct Game *game, struct Moonwalk *data);
|
||||
|
|
Loading…
Reference in a new issue