add rotating middle platforms

This commit is contained in:
Lephenixnoir 2021-08-21 22:09:32 +02:00
parent 0505a9b340
commit 1771e691ec
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
6 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,8 @@
#It's good to see you.\n\nStay close to me and\ndon't touch anything.
long_vertical middle
left

View File

@ -1,2 +1,2 @@
#This will be full of\nunexpected twists and turns.
middle rotate
middle rotate_right

View File

@ -77,7 +77,7 @@ def convert_level(input, output, params, target):
shape = 4
if shape < 0 or action < 0 or position < 0:
raise fxconv.FxconvError("Incomplete in '" + " ".join(r) + "'")
raise fxconv.FxconvError("Incomplete data: '" + " ".join(r) + "'")
blocks += fxconv.u32(tempo)
blocks += fxconv.u32(shape)

View File

@ -30,7 +30,7 @@ typedef enum {
Action_Speed = 3,
Action_FadeOut = 4,
Action_OuterRotateLeft = 5,
Action_OuterRotateRIght = 6,
Action_OuterRotateRight = 6,
Action_Slide = 7,
} action_t;

View File

@ -55,7 +55,7 @@ int main(void)
&level1, &level2, &level3, &level4, &level5, &level6, &level7,
&level8, &level9, &level10, NULL,
};
int story_position = 0;
int story_position = 5;
game_t game;
load_level(&game, story_levels[story_position]);

View File

@ -114,9 +114,17 @@ void rect_load(rect_t *r, rectmeta_t const *meta)
void rect_physics(rect_t *r, rectmeta_t const *meta, float absolute_time)
{
// TODO: Use position and actions
float time = absolute_time - meta->time; /* <= 0 most of the time */
r->x = PLAYER_X - RECT_SPEED * time;
r->r = 0;
if(meta->action == Action_RotateLeft) {
float vr = 2.0; /* rad/tempo */
r->r = -0.3 + time * vr;
}
else if(meta->action == Action_RotateRight) {
float vr = 2.0; /* rad/tempo */
r->r = 0.3 - time * vr;
}
}