From 06bfa0bef450c37273b7957b83baac51c5fc69d4 Mon Sep 17 00:00:00 2001 From: Wintermute Date: Mon, 14 Oct 2013 20:31:02 +0200 Subject: [PATCH] wolfpros Levelansatz. Problem scheint behoben zu sein. --- badge/jumpnrun/enemies.c | 2 +- badge/jumpnrun/foo.lv | 31 +++++++++++++++++++++++++++++++ badge/jumpnrun/gnobbel.lv | 1 + badge/jumpnrun/levels.txt | 2 ++ badge/util/fixed_point.h | 6 +++--- 5 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 badge/jumpnrun/foo.lv diff --git a/badge/jumpnrun/enemies.c b/badge/jumpnrun/enemies.c index dfcc439..3900a27 100644 --- a/badge/jumpnrun/enemies.c +++ b/badge/jumpnrun/enemies.c @@ -192,7 +192,7 @@ void enemy_tick_swing_up_and_down(struct jumpnrun_enemy *self, } self->base.inertia.y = fixed_point_add(self->base.inertia.y, - fixed_point_mul(FIXED_POINT(0, 5), + fixed_point_mul(fixed_point_div(self->type->spawn_inertia.y, FIXED_INT(40)), fixed_point_sub(self->spawn_pos.y, self->base.current_box.pos.y))); diff --git a/badge/jumpnrun/foo.lv b/badge/jumpnrun/foo.lv new file mode 100644 index 0000000..b4cf314 --- /dev/null +++ b/badge/jumpnrun/foo.lv @@ -0,0 +1,31 @@ + ############# + ## + ## + ## + ## + ## + 01 + 23 + 23 + 23 + P M 23 D + 23 +######################################################################################################################################################################################################################################### + +[tiles] +0 tube_top_left +1 tube_top_right +2 tube_left +3 tube_right +# brick +? square + +[items] +D doc + +[enemies] +C cat +M mushroom +B bunny +S snake +@ spiral diff --git a/badge/jumpnrun/gnobbel.lv b/badge/jumpnrun/gnobbel.lv index 73d790c..d31670d 100644 --- a/badge/jumpnrun/gnobbel.lv +++ b/badge/jumpnrun/gnobbel.lv @@ -11,6 +11,7 @@ ####### ######## DC ###################################### ################# ## ## ######### + [tiles] 0 tube_top_left 1 tube_top_right diff --git a/badge/jumpnrun/levels.txt b/badge/jumpnrun/levels.txt index f1f803c..c6bfbe0 100644 --- a/badge/jumpnrun/levels.txt +++ b/badge/jumpnrun/levels.txt @@ -1,2 +1,4 @@ smb +foo +gnobbel mean diff --git a/badge/util/fixed_point.h b/badge/util/fixed_point.h index 8af7e82..49bfa7c 100644 --- a/badge/util/fixed_point.h +++ b/badge/util/fixed_point.h @@ -25,12 +25,12 @@ static inline bool fixed_point_ne(fixed_point x, fixed_point y) { return x.data #define FIXED_POINT_I(x, y) { ((x) * 256) + ((y) * 256 / 1000) } #define FIXED_INT_I(x) FIXED_POINT_I(x, 0) -static inline fixed_point FIXED_POINT(unsigned x, unsigned y) { - fixed_point r = { ((int) x * 256) + ((int) y * 256 / 1000) }; +static inline fixed_point FIXED_POINT(int32_t x, int32_t y) { + fixed_point r = { (x * 256) + (y * 256 / 1000) }; return r; } -static inline fixed_point FIXED_INT(unsigned x) { return FIXED_POINT(x, 0); } +static inline fixed_point FIXED_INT(int32_t x) { return FIXED_POINT(x, 0); } static inline int fixed_point_cast_int(fixed_point x) { return x.data / 256; } -- 2.20.1