diff --git a/data_mfed/resdecl_mfed.rd b/data_mfed/resdecl_mfed.rd new file mode 100644 index 0000000..ca9651f --- /dev/null +++ b/data_mfed/resdecl_mfed.rd @@ -0,0 +1,7 @@ +// Copyright © 2017 Project Golan, all rights reserved. + +include "resdecl.rd" + +font "editor" = "fonts/editor.otf", 24 + +// EOF diff --git a/src/g_player.c b/src/g_player.c index 8d7ee94..b5e2bd0 100644 --- a/src/g_player.c +++ b/src/g_player.c @@ -12,10 +12,10 @@ // // G_Player_applyVelocity // -void G_Player_applyVelocity(DGE_Entity ent) +static void G_Player_applyVelocity(DGE_Entity ent) { - accum vx = (accum)DGE_GetInputAxis(0, DGE_Axis_X); - accum vy = (accum)DGE_GetInputAxis(0, DGE_Axis_Y); + DGE_Point2R ax = DGE_Input_GetAxis(1); + accum vx = (accum)ax.x, vy = (accum)ax.y; float mag = sqrtf(vx * vx + vy * vy); float ang = atan2f(vy, vx); @@ -25,6 +25,8 @@ void G_Player_applyVelocity(DGE_Entity ent) ent.vx = ent.vx + c * mag * 1.1; ent.vy = ent.vy - s * mag * 1.1; + + // TODO: apply animation based on X velocity here } // Extern Functions ----------------------------------------------------------| diff --git a/src/g_stage.c b/src/g_stage.c index 5b6470f..31397ea 100644 --- a/src/g_stage.c +++ b/src/g_stage.c @@ -13,7 +13,7 @@ // Extern Objects ------------------------------------------------------------| -char const *G_place = u8"地球軌道・朝"; +char const *G_Place = u8"地球軌道・朝"; // Static Functions ----------------------------------------------------------| diff --git a/src/g_stage.h b/src/g_stage.h index fe5d807..06cbd69 100644 --- a/src/g_stage.h +++ b/src/g_stage.h @@ -41,7 +41,7 @@ typedef struct G_stage // Extern Objects ------------------------------------------------------------| -extern char const *G_place; +extern char const *G_Place; // Extern Functions ----------------------------------------------------------| diff --git a/src/main.c b/src/main.c index 6f2ebe8..2203cc1 100644 --- a/src/main.c +++ b/src/main.c @@ -12,7 +12,7 @@ // // GInit // -void GInit(void) +void GInit(char const *resdecl) { extern void R_ResDec_Load(char const *fname); @@ -23,7 +23,7 @@ void GInit(void) DGE_Renderer_SetVirtualRes(960, 720); printf("Loading resource declarations...\n"); - R_ResDec_Load("resdecl.rd"); + R_ResDec_Load(resdecl); printf("Loading object function table...\n"); G_ObjDef_Init(); @@ -45,7 +45,7 @@ void GInit(void) [[__extern("asm")]] DGE_Callback void main(void) { - GInit(); + GInit("resdecl.rd"); G_Stage_Begin(1); } diff --git a/src/mfed.c b/src/mfed.c index 6c59407..318fa44 100644 --- a/src/mfed.c +++ b/src/mfed.c @@ -15,9 +15,8 @@ [[__extern("asm")]] DGE_Callback void main(void) { - extern void GInit(void); - GInit(); - printf("using mfed main\n"); + extern void GInit(char const *resdecl); + GInit("resdecl_mfed.rd"); } // EOF diff --git a/src/r_draw.c b/src/r_draw.c index 341cfcc..9214ebd 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -54,8 +54,8 @@ void R_DrawPost(ulfra delta) DGE_Draw_Rectangle(0, 0, 960, 720); DGE_Font_Bind(DGE_Font_Get(s"base")); - DGE_Draw_SetTextAlign(DGE_Align_Center); - DGE_Draw_Text(760, 20, G_place); + DGE_Draw_SetTextAlign(DGE_Align_Center, DGE_Align_Top); + DGE_Draw_Text(760, 20, G_Place); DGE_Draw_SetTextAlign(DGE_Align_Left); DGE_Draw_Text(585, 70, u8"ハイスコア\nスコア\n\n残り再試行回"); DGE_Draw_SetTextAlign(DGE_Align_Right);