mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-01-05 22:48:02 +01:00
lots of level 1 tweaks
This commit is contained in:
parent
d0ac545e4b
commit
001ed62181
8 changed files with 64 additions and 43 deletions
|
@ -196,16 +196,13 @@ void AdvanceLevel(struct Game *game, int current_level, bool last) {
|
||||||
return name;
|
return name;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
void DrawCharacter(struct Game *game, struct Character *character, int flags) {
|
void DrawCharacter(struct Game *game, struct Character *character, ALLEGRO_COLOR tilt, int flags) {
|
||||||
// TODO: support for additional states, like being hit (transparency, color tilt etc.)
|
|
||||||
bool colision = false;
|
|
||||||
|
|
||||||
al_set_target_bitmap(character->bitmap);
|
al_set_target_bitmap(character->bitmap);
|
||||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
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_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_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 ;_;
|
al_draw_tinted_rotated_bitmap(character->bitmap, tilt, 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 ;_;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void AdvanceLevel(struct Game *game, int current_level, bool last);
|
||||||
/*! \brief Replaces first '?' char in filename with current level number. */
|
/*! \brief Replaces first '?' char in filename with current level number. */
|
||||||
char* GetLevelFilename(struct Game *game, char* filename);
|
char* GetLevelFilename(struct Game *game, char* filename);
|
||||||
|
|
||||||
void DrawCharacter(struct Game *game, struct Character *character, int flags);
|
void DrawCharacter(struct Game *game, struct Character *character, ALLEGRO_COLOR tilt, int flags);
|
||||||
|
|
||||||
struct Character* CreateCharacter(struct Game *game, char* name);
|
struct Character* CreateCharacter(struct Game *game, char* name);
|
||||||
void DestroyCharacter(struct Game *game, struct Character *character);
|
void DestroyCharacter(struct Game *game, struct Character *character);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "allegro5/allegro_ttf.h"
|
#include "allegro5/allegro_ttf.h"
|
||||||
|
#include "../timeline.h"
|
||||||
#include "../gamestates/level.h"
|
#include "../gamestates/level.h"
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "../utils.h"
|
#include "../utils.h"
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
#include "modules/dodger/actions.h"
|
#include "modules/dodger/actions.h"
|
||||||
#include "level1.h"
|
#include "level1.h"
|
||||||
|
|
||||||
int Gamestate_ProgressCount = 9001;
|
int Gamestate_ProgressCount = 2;
|
||||||
|
|
||||||
void Gamestate_Start(struct Game *game, struct Level1Resources* data) {
|
void Gamestate_Start(struct Game *game, struct Level1Resources* data) {
|
||||||
TM_AddBackgroundAction(&FadeIn, NULL, 0, "fadein");
|
TM_AddBackgroundAction(&FadeIn, NULL, 0, "fadein");
|
||||||
|
@ -58,7 +59,11 @@ void Gamestate_Start(struct Game *game, struct Level1Resources* data) {
|
||||||
// second part gameplay goes here
|
// second part gameplay goes here
|
||||||
|
|
||||||
// cutscene goes here */
|
// cutscene goes here */
|
||||||
TM_AddAction(&PassLevel, NULL, "passlevel");
|
|
||||||
|
struct TM_Arguments *args = TM_AddToArgs(NULL, strdup("level1"));
|
||||||
|
TM_WrapArg(int, level, 1);
|
||||||
|
TM_AddToArgs(args, level);
|
||||||
|
TM_AddAction(&PassLevel, args, "passlevel");
|
||||||
|
|
||||||
// init level specific obstacle (owl) for Dodger module
|
// init level specific obstacle (owl) for Dodger module
|
||||||
struct Obstacle *obst = malloc(sizeof(struct Obstacle));
|
struct Obstacle *obst = malloc(sizeof(struct Obstacle));
|
||||||
|
@ -170,9 +175,18 @@ struct Level1Resources* Gamestate_Load(struct Game *game) {
|
||||||
RegisterSpritesheet(game, character, "stand");
|
RegisterSpritesheet(game, character, "stand");
|
||||||
RegisterSpritesheet(game, character, "fly");
|
RegisterSpritesheet(game, character, "fly");
|
||||||
RegisterSpritesheet(game, character, "run");
|
RegisterSpritesheet(game, character, "run");
|
||||||
SelectSpritesheet(game, character, "stand");
|
SelectSpritesheet(game, character, "walk");
|
||||||
|
SetCharacterPosition(game, character, 0.1, 0.7, 0);
|
||||||
data->dodger = Dodger_Load(game, character);
|
data->dodger = Dodger_Load(game, character);
|
||||||
|
|
||||||
|
data->failed=false;
|
||||||
|
data->cl_pos=0;
|
||||||
|
data->bg_pos=0;
|
||||||
|
data->fg_pos=0.2;
|
||||||
|
data->st_pos=0.1;
|
||||||
|
data->handle_input = false;
|
||||||
|
data->meter_alpha=0;
|
||||||
|
|
||||||
Gamestate_PreloadBitmaps(game, data);
|
Gamestate_PreloadBitmaps(game, data);
|
||||||
LoadSpritesheets(game, character);
|
LoadSpritesheets(game, character);
|
||||||
return data;
|
return data;
|
||||||
|
@ -184,14 +198,12 @@ void Gamestate_Draw(struct Game *game, struct Level1Resources* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gamestate_Logic(struct Game *game, struct Level1Resources* data) {
|
void Gamestate_Logic(struct Game *game, struct Level1Resources* data) {
|
||||||
|
TM_Process();
|
||||||
Dodger_Logic(game, data->dodger);
|
Dodger_Logic(game, data->dodger);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gamestate_Keydown(struct Game *game, struct Level1Resources* data, ALLEGRO_EVENT *ev) {
|
|
||||||
Dodger_Keydown(game, data->dodger, ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Gamestate_ProcessEvent(struct Game *game, struct Level1Resources* data, ALLEGRO_EVENT *ev) {
|
void Gamestate_ProcessEvent(struct Game *game, struct Level1Resources* data, ALLEGRO_EVENT *ev) {
|
||||||
|
TM_HandleEvent(ev);
|
||||||
Dodger_ProcessEvent(game, data->dodger, ev);
|
Dodger_ProcessEvent(game, data->dodger, ev);
|
||||||
if (ev->type == ALLEGRO_EVENT_KEY_DOWN) {
|
if (ev->type == ALLEGRO_EVENT_KEY_DOWN) {
|
||||||
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
||||||
|
|
|
@ -84,6 +84,7 @@ void Gamestate_Logic(struct Game *game, struct LevelXResources* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gamestate_ProcessEvent(struct Game *game, struct LevelXResources* data, ALLEGRO_EVENT *ev) {
|
void Gamestate_ProcessEvent(struct Game *game, struct LevelXResources* data, ALLEGRO_EVENT *ev) {
|
||||||
|
TM_HandleEvent(ev);
|
||||||
Moonwalk_ProcessEvent(game, data->moonwalk, ev);
|
Moonwalk_ProcessEvent(game, data->moonwalk, ev);
|
||||||
if (ev->type == ALLEGRO_EVENT_KEY_DOWN) {
|
if (ev->type == ALLEGRO_EVENT_KEY_DOWN) {
|
||||||
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "dodger.h"
|
#include "dodger.h"
|
||||||
#include "dodger/actions.h"
|
#include "dodger/actions.h"
|
||||||
|
|
||||||
|
int Dodger_ProgressCount = 0;
|
||||||
|
|
||||||
void Dodger_Logic(struct Game *game, struct Dodger* data) {
|
void Dodger_Logic(struct Game *game, struct Dodger* data) {
|
||||||
struct ALLEGRO_KEYBOARD_STATE keyboard;
|
struct ALLEGRO_KEYBOARD_STATE keyboard;
|
||||||
al_get_keyboard_state(&keyboard);
|
al_get_keyboard_state(&keyboard);
|
||||||
|
@ -57,10 +59,10 @@ void Dodger_Logic(struct Game *game, struct Dodger* data) {
|
||||||
if ( data->character->y < 0) data->character->y=0;
|
if ( data->character->y < 0) data->character->y=0;
|
||||||
else if ( data->character->y > 0.8) data->character->y=0.8;
|
else if ( data->character->y > 0.8) data->character->y=0.8;
|
||||||
|
|
||||||
data->character->y += data->character->angle / 30;
|
MoveCharacter(game, data->character, 0, data->character->angle / 30, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int derpyx = data->character->x*game->viewport.height*1.6;
|
int derpyx = data->character->x*game->viewport.width;
|
||||||
int derpyy = data->character->y*game->viewport.height;
|
int derpyy = data->character->y*game->viewport.height;
|
||||||
int derpyw = al_get_bitmap_width(data->character->bitmap);
|
int derpyw = al_get_bitmap_width(data->character->bitmap);
|
||||||
int derpyh = al_get_bitmap_height(data->character->bitmap);
|
int derpyh = al_get_bitmap_height(data->character->bitmap);
|
||||||
|
@ -119,6 +121,7 @@ void Dodger_Logic(struct Game *game, struct Dodger* data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if (colision) data->hp-=tps(game, 60*0.002);*/
|
/*if (colision) data->hp-=tps(game, 60*0.002);*/
|
||||||
|
AnimateCharacter(game, data->character, data->speed_modifier);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,12 +171,13 @@ void Dodger_Draw(struct Game *game, struct Dodger* data) {
|
||||||
}
|
}
|
||||||
/*if (colision) data->hp-=tps(game, 60*0.002);*/
|
/*if (colision) data->hp-=tps(game, 60*0.002);*/
|
||||||
|
|
||||||
al_set_target_bitmap(data->character->bitmap);
|
/* al_set_target_bitmap(data->character->bitmap);
|
||||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
al_clear_to_color(al_map_rgba(0,0,0,0));
|
||||||
al_draw_bitmap_region(data->character->spritesheet->bitmap,al_get_bitmap_width(data->character->bitmap)*(data->character->pos%data->character->spritesheet->cols),al_get_bitmap_height(data->character->bitmap)*(data->character->pos/data->character->spritesheet->cols),al_get_bitmap_width(data->character->bitmap), al_get_bitmap_height(data->character->bitmap),0,0,0);
|
al_draw_bitmap_region(data->character->spritesheet->bitmap,al_get_bitmap_width(data->character->bitmap)*(data->character->pos%data->character->spritesheet->cols),al_get_bitmap_height(data->character->bitmap)*(data->character->pos/data->character->spritesheet->cols),al_get_bitmap_width(data->character->bitmap), al_get_bitmap_height(data->character->bitmap),0,0,0);
|
||||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
|
|
||||||
al_draw_tinted_rotated_bitmap(data->character->bitmap, al_map_rgba(255,255-colision*255,255-colision*255,255), al_get_bitmap_width(data->character->bitmap), al_get_bitmap_height(data->character->bitmap)/2, derpyx+game->viewport.height*1.6*0.1953125, derpyy + al_get_bitmap_height(data->character->bitmap)/2, data->character->angle, 0);
|
al_draw_tinted_rotated_bitmap(data->character->bitmap, al_map_rgba(255,255-colision*255,255-colision*255,255), al_get_bitmap_width(data->character->bitmap), al_get_bitmap_height(data->character->bitmap)/2, derpyx+game->viewport.height*1.6*0.1953125, derpyy + al_get_bitmap_height(data->character->bitmap)/2, data->character->angle, 0);*/
|
||||||
|
DrawCharacter(game, data->character, al_map_rgba(255,255-colision*255,255-colision*255,255), 0);
|
||||||
|
|
||||||
/* if ((((x>=derpyx+0.36*derpyw) && (x<=derpyx+0.94*derpyw)) || ((x+w>=derpyx+0.36*derpyw) && (x+w<=derpyx+0.94*derpyw))) &&
|
/* if ((((x>=derpyx+0.36*derpyw) && (x<=derpyx+0.94*derpyw)) || ((x+w>=derpyx+0.36*derpyw) && (x+w<=derpyx+0.94*derpyw))) &&
|
||||||
(((y>=derpyy+0.26*derpyh) && (y<=derpyy+0.76*derpyh)) || ((y+h>=derpyy+0.26*derpyh) && (y+h<=derpyy+0.76*derpyh)))) {
|
(((y>=derpyy+0.26*derpyh) && (y<=derpyy+0.76*derpyh)) || ((y+h>=derpyy+0.26*derpyh) && (y+h<=derpyy+0.76*derpyh)))) {
|
||||||
|
@ -188,17 +192,15 @@ struct Dodger* Dodger_Load(struct Game *game, struct Character *character) {
|
||||||
struct Dodger *data = malloc(sizeof(struct Dodger));
|
struct Dodger *data = malloc(sizeof(struct Dodger));
|
||||||
data->obstacles = NULL;
|
data->obstacles = NULL;
|
||||||
data->character = character;
|
data->character = character;
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Dodger_Keydown(struct Game *game, struct Dodger* data, ALLEGRO_EVENT *ev) {
|
data->failed=false;
|
||||||
if (data->handle_input) {
|
data->hp=1;
|
||||||
if (ev->keyboard.keycode==ALLEGRO_KEY_LEFT) {
|
data->speed = 0;
|
||||||
data->speed_modifier = 0.75;
|
data->speed_modifier = 1;
|
||||||
} else if (ev->keyboard.keycode==ALLEGRO_KEY_RIGHT) {
|
data->handle_input = true;
|
||||||
data->speed_modifier = 1.3;
|
data->debug_show_sprite_frames=false;
|
||||||
}
|
|
||||||
}
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dodger_ProcessEvent(struct Game *game, struct Dodger* data, ALLEGRO_EVENT *ev) {
|
void Dodger_ProcessEvent(struct Game *game, struct Dodger* data, ALLEGRO_EVENT *ev) {
|
||||||
|
|
|
@ -24,11 +24,19 @@
|
||||||
#include "../../actions.h"
|
#include "../../actions.h"
|
||||||
#include "../../../gamestates/level.h"
|
#include "../../../gamestates/level.h"
|
||||||
|
|
||||||
void SelectDerpySpritesheet(void* a, void* b) {
|
// TODO: make it configurable and move to generic actions
|
||||||
|
// args: struct Character* character
|
||||||
|
bool Walk(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
|
if (state == TM_ACTIONSTATE_START) return false; //SelectDerpySpritesheet(game, "walk");
|
||||||
|
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||||
|
//game->level.derpy_x+=(0.00125*1280)/(float)game->viewportWidth;
|
||||||
|
//if (game->level.derpy_x>=(0.05*1280)/(float)game->viewportWidth) return true;
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: make it configurable and move to generic actions
|
// TODO: make it configurable
|
||||||
|
// args: struct Dodger* data
|
||||||
bool Accelerate(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
bool Accelerate(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
if (state != TM_ACTIONSTATE_RUNNING) return false;
|
if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||||
//game->level.speed+=0.000015;
|
//game->level.speed+=0.000015;
|
||||||
|
@ -36,26 +44,19 @@ bool Accelerate(struct Game *game, struct TM_Action *action, enum TM_ActionState
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: make it configurable and move to generic actions
|
// args: struct Dodger* data
|
||||||
bool Walk(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
|
||||||
if (state == TM_ACTIONSTATE_START) SelectDerpySpritesheet(game, "walk");
|
|
||||||
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
|
||||||
//game->level.derpy_x+=(0.00125*1280)/(float)game->viewportWidth;
|
|
||||||
//if (game->level.derpy_x>=(0.05*1280)/(float)game->viewportWidth) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: make it configurable and move to generic actions
|
|
||||||
bool Move(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
bool Move(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
if (state != TM_ACTIONSTATE_RUNNING) return false;
|
if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||||
// game->level.speed=0.000345;
|
// game->level.speed=0.000345;
|
||||||
// if (game->level.st_pos>=0.275) return true;
|
// if (game->level.st_pos>=0.275) return true;
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// args: struct Dodger* data
|
||||||
bool Fly(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
bool Fly(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
if (state == TM_ACTIONSTATE_START) {
|
if (state == TM_ACTIONSTATE_START) {
|
||||||
SelectDerpySpritesheet(game, "fly");
|
// SelectDerpySpritesheet(game, "fly");
|
||||||
// game->level.derpy_angle = -0.15;
|
// game->level.derpy_angle = -0.15;
|
||||||
TM_AddBackgroundAction(&ShowMeter, NULL, 0, "showmeter");
|
TM_AddBackgroundAction(&ShowMeter, NULL, 0, "showmeter");
|
||||||
}
|
}
|
||||||
|
@ -65,9 +66,11 @@ bool Fly(struct Game *game, struct TM_Action *action, enum TM_ActionState state)
|
||||||
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||||
// game->level.derpy_y-=0.004;
|
// game->level.derpy_y-=0.004;
|
||||||
// if (game->level.derpy_y<=0.2) return true;
|
// if (game->level.derpy_y<=0.2) return true;
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// args: struct Dodger* data
|
||||||
bool Run(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
bool Run(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
if (state == TM_ACTIONSTATE_START) {
|
if (state == TM_ACTIONSTATE_START) {
|
||||||
// game->level.handle_input=false;
|
// game->level.handle_input=false;
|
||||||
|
@ -75,16 +78,18 @@ bool Run(struct Game *game, struct TM_Action *action, enum TM_ActionState state)
|
||||||
}
|
}
|
||||||
else if (state == TM_ACTIONSTATE_DESTROY) {
|
else if (state == TM_ACTIONSTATE_DESTROY) {
|
||||||
// game->level.derpy_angle = 0;
|
// game->level.derpy_angle = 0;
|
||||||
SelectDerpySpritesheet(game, "run");
|
// SelectDerpySpritesheet(game, "run");
|
||||||
}
|
}
|
||||||
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
else if (state != TM_ACTIONSTATE_RUNNING) return false;
|
||||||
// game->level.derpy_y+=0.0042;
|
// game->level.derpy_y+=0.0042;
|
||||||
// if (game->level.derpy_angle > 0) { game->level.derpy_angle -= 0.02; if (game->level.derpy_angle < 0) game->level.derpy_angle = 0; }
|
// if (game->level.derpy_angle > 0) { game->level.derpy_angle -= 0.02; if (game->level.derpy_angle < 0) game->level.derpy_angle = 0; }
|
||||||
// if (game->level.derpy_angle < 0) { game->level.derpy_angle += 0.02; if (game->level.derpy_angle > 0) game->level.derpy_angle = 0; }
|
// if (game->level.derpy_angle < 0) { game->level.derpy_angle += 0.02; if (game->level.derpy_angle > 0) game->level.derpy_angle = 0; }
|
||||||
// if (game->level.derpy_y>=0.65) return true;
|
// if (game->level.derpy_y>=0.65) return true;
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// args: struct Dodger* data
|
||||||
bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_ActionState state) {
|
||||||
int* count;
|
int* count;
|
||||||
if (!action->arguments) {
|
if (!action->arguments) {
|
||||||
|
@ -175,5 +180,6 @@ bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_Acti
|
||||||
TM_DestroyArgs(action->arguments);
|
TM_DestroyArgs(action->arguments);
|
||||||
action->arguments = NULL;
|
action->arguments = NULL;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void Moonwalk_Logic(struct Game *game, struct Moonwalk *data) {
|
||||||
|
|
||||||
void Moonwalk_Draw(struct Game *game, struct Moonwalk *data) {
|
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);
|
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);
|
DrawCharacter(game, data->derpy, al_map_rgba(255,255,255,255), ALLEGRO_FLIP_HORIZONTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Moonwalk_Start(struct Game *game, struct Moonwalk *data) {
|
void Moonwalk_Start(struct Game *game, struct Moonwalk *data) {
|
||||||
|
|
|
@ -18,11 +18,14 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TIMELINE_H
|
#ifndef TIMELINE_H
|
||||||
#define TIMELINE_H
|
#define TIMELINE_H
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
|
#define TM_WrapArg(type, result, val) type* result = malloc(sizeof(type)); *result = val;
|
||||||
|
|
||||||
/*! \brief State of the TM_Action. */
|
/*! \brief State of the TM_Action. */
|
||||||
enum TM_ActionState {
|
enum TM_ActionState {
|
||||||
TM_ACTIONSTATE_INIT,
|
TM_ACTIONSTATE_INIT,
|
||||||
|
|
Loading…
Reference in a new issue