Skip to content

Commit

Permalink
add more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolina committed Feb 2, 2019
1 parent 57a2f29 commit c3e37fc
Show file tree
Hide file tree
Showing 9 changed files with 1,166 additions and 1,156 deletions.
9 changes: 7 additions & 2 deletions defines.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ void reset_misifu_position() {
misifu.draw_additional = NONE;
misifu.offset = RIGHTC1;
misifu.state = NONE;
zx_border(INK_BLACK);
sp1_UpdateNow();
aux_object.offset = AUX_BROOM;
sp1_MoveSprAbs(aux_object.sp, &full_screen,(void*) aux_object.offset, 0, 33, 0, 0);
opened_window = NONE;
x_malo = 33;
points = 0;
}
Expand Down Expand Up @@ -403,6 +403,9 @@ void check_keys()
in_wait_nokey();
paws = 1;
}
if (in_key_pressed(IN_KEY_SCANCODE_1)) {
print_background_level7();
}
}

void check_swim() {
Expand Down Expand Up @@ -694,6 +697,8 @@ void get_out_of_level_generic(uint8_t fall) {
wait();
}
bit_beepfx_di_fastcall(BEEPFX_SELECT_5);
} else if(fall == FALLING) {
bit_beepfx_di_fastcall(BEEPFX_UH_HUH);
} else {
loose_a_live();
}
Expand Down
10 changes: 2 additions & 8 deletions level2.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ const uint8_t hole_empty[] = {0x3c, 0x7e, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x3c};
const uint8_t hole_mouse[] = {0x3c, 0x5a, 0xe7, 0xc3, 0xa5, 0xe7, 0x5a, 0x3c};
const uint8_t cheese2[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};

/**
Returns 1 if x,y are in window position
**/
uint8_t thrown_from_window(uint8_t x, uint8_t y) {
return (x>7 && x < 10 && y > 21 && y < 26);
}

void define_cheese_holes_pos() {
// init to zero
Expand Down Expand Up @@ -81,7 +75,8 @@ void detect_fall_in_hole_or_curtain() {
static void move_misifu(uint8_t index) {
first_keypress = index;
misifu.x = windows[index].x - 2;
misifu.y = windows[index].y;
misifu.y = windows[index].y - 1;
misifu.state = FALLING;
}

void level2_loop() {
Expand Down Expand Up @@ -192,7 +187,6 @@ void print_background_level2() {

aux_object.y = 5;
aux_object.x = 5;
aux_object.offset = AUX_BROOM;
repaint_lives = 1;
level_x_max = 28;
level_x_min = 0;
Expand Down
1 change: 0 additions & 1 deletion level3.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void print_background_level3() {

aux_object.y = 5;
aux_object.x = 5;
aux_object.offset = AUX_BROOM;
repaint_lives = 1;

level_x_max = 28;
Expand Down
2 changes: 1 addition & 1 deletion level4.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void print_fish(uint8_t idx, uint8_t to_print) {
}

inline void eels_on_move() {
if(random_value < 10) {
if(random_value < 40) {
for(idx = 0; idx != 5; ++idx) {
print_eel(floor_holes[idx][Y_POS], floor_holes[idx][X_POS], ' ');
if(floor_holes[idx][X_POS] > 30) {
Expand Down
8 changes: 6 additions & 2 deletions level5.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ void print_background_level5() {
}

static void anim_spider() {
if(random_value < 29 && random_value > 14 && bincat_appears == NONE) {
if(random_value < 18 && bincat_appears == NONE) {
if(random_value < 4) {
windows[0].x = misifu.x;
}

windows[0].x = random_value;
windows[0].y = 3;
bincat_appears = 15;
Expand Down Expand Up @@ -128,7 +132,7 @@ static inline void detect_vase_falling() {
vase_falls(1);
} else if(misifu.x >= 22 && misifu.x < 25) {
vase_falls(2);
} else if(misifu.x >= 27 && misifu.x < 29) {
} else if(misifu.x >= 26 && misifu.x < 29) {
vase_falls(3);
}

Expand Down
2 changes: 1 addition & 1 deletion level6.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void print_background_level6() {

static void check_cage_and_bird() {
// todo think on moving cage
if(misifu.y == 16 && misifu.x == windows[0].x && windows[0].has_item == BIRD) {
if(misifu.y == 16 && abs(misifu.x - windows[0].x) < 2 && windows[0].has_item == BIRD) {
windows[0].has_item = RIGHT;
misifu.state = FALLING;
sp1_PrintAtInv(17, 26, INK_GREEN | PAPER_RED, ' ');
Expand Down
13 changes: 11 additions & 2 deletions level7.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void print_background_level7() {
level_x_max = 26;
level_x_min = 2;
eaten_items = 6;
horizontal_direction = 3; // you can touch up to three dogs before getting out of level

print_room_walls(20, PAPER_MAGENTA, INK_CYAN);
idx = 0;
Expand All @@ -60,14 +61,21 @@ static inline void drink_milk_or_got_awaken(uint8_t index) {
sp1_PrintAtInv(windows[index].y, windows[index].x + 4, INK_GREEN | PAPER_MAGENTA, 'O');
windows[index].has_item = 'Z';
--eaten_items;
bit_beepfx_di_fastcall(BEEPFX_SELECT_4);
bit_beepfx_di_fastcall(BEEPFX_EAT);

if(eaten_items == 0) {
get_out_of_level_generic(WON_LEVEL);
}
}
} else {
get_out_of_level_generic(DOG_AWAKEN);
--horizontal_direction;
bit_beepfx_di_fastcall(BEEPFX_GULP);
misifu.state = JUMPING_PUSHED;
misifu.draw_additional = JUMP_RIGHT;

if(horizontal_direction == 0) {
get_out_of_level_generic(DOG_AWAKEN);
}
}
}

Expand Down Expand Up @@ -110,4 +118,5 @@ static void check_eat_milk_or_dog() {
void level7_loop() {
check_eat_milk_or_dog();
move_broom();
detect_cat_in_window(0);
}
2 changes: 1 addition & 1 deletion level_last.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ inline void heavencat_on_move() {

// detect collision with misifu
idx_j = lvl3_y_to_idj(misifu.y);
if(idx_j != UNDEF && abs(misifu.x - udgxs[idx_j]) < 2) {
if(idx_j < 4 && abs(misifu.x - udgxs[idx_j]) < 2) {
misifu.state = FALLING;
bit_beepfx_di_fastcall(BEEPFX_HIT_1);
}
Expand Down
Loading

0 comments on commit c3e37fc

Please sign in to comment.