Skip to content

Commit

Permalink
fix(realpacman) right sounds and game over map fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolina committed Dec 22, 2021
1 parent d34ce64 commit a553491
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions fx/effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ PUBLIC fxComeFruta
PUBLIC fxComeFantasma
PUBLIC fxOjosACasa
PUBLIC fxMuerte
; es una música que se pone cuando llevas mucho tiempo en el nivel y no acabas de comer todas las bolas
PUBLIC fxTinTin
PUBLIC fxSirena1
PUBLIC fxSirena2
Expand Down
3 changes: 1 addition & 2 deletions globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ uint8_t map3[25][32] = {
};

uint8_t * currentmap;
// todo puntero al mapa actual, posiciones diferentes para el mapa

// 15

Expand Down Expand Up @@ -118,7 +117,7 @@ uint8_t row;
uint8_t col;
uint8_t current;
uint16_t points = 0;
uint8_t remaining_points = MAP1_TOTAL_POINTS;
uint8_t remaining_points;

uint8_t frame = 0;

Expand Down
14 changes: 14 additions & 0 deletions int.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,20 @@ __asm
__endasm;
}

void sonido3InsertCoin() {
__asm
extern fxInsert_coin
extern Load_Fx
extern enable_bank_6
extern restore_bank_0
;ld a, 6
call enable_bank_6
ld a, 3
ld hl, fxInsert_coin
call Load_Fx
call restore_bank_0
__endasm;
}

void sonido13ComeGhost() {
__asm
Expand Down
1 change: 1 addition & 0 deletions int.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ extern void stopCanal3();
extern void stopCanal2();
extern void incSiren();
extern void resetSiren();
extern inline void sonido3InsertCoin();

#endif
15 changes: 5 additions & 10 deletions logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ void move_ghosts() {


void next_level() {
// todo sound for next leevel
resetSiren();
sonido3InsertCoin();
++level;
// helps determining scatter mode changes and some others
slowticker = 0;
Expand All @@ -593,18 +593,13 @@ void next_level() {

if(map_num == 1) {
remaining_points = MAP1_TOTAL_POINTS;
currentmap = &map[0][0];
} else if(map_num == 2){
// se pone este al morir
remaining_points = MAP2_TOTAL_POINTS;
} else if(map_num == 3){
remaining_points = MAP3_TOTAL_POINTS;
}


if(map_num == 1) {
currentmap = &map[0][0];
} else if(map_num == 2) {
currentmap = &map2[0][0];
} else {
} else if(map_num == 3) {
remaining_points = MAP3_TOTAL_POINTS;
currentmap = &map3[0][0];
}

Expand Down
9 changes: 4 additions & 5 deletions msnampac.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ void all_lives_lost() {

zx_border(INK_BLACK);
sp1_Invalidate(&full_screen);
currentmap = &map[0][0];
lives = 5;
points = 0;
level = 0;
map_num = 1;
repaint_lives = 1;
reached_level = 0;

resetSiren();


Expand Down Expand Up @@ -104,11 +107,9 @@ void all_lives_lost() {
}

srand(tick);

remaining_points = MAP1_TOTAL_POINTS;
nampac_go_home();

reset_map();

set_ghosts_default_coords();
all_ghosts_go_home();
start_ay();
Expand All @@ -120,7 +121,6 @@ void all_lives_lost() {
hide_billboard();
sonido2Sirena();
pick = 1;
reached_level = 0;
slowticker = 0;
}

Expand All @@ -133,7 +133,6 @@ int main()
pacman.alt = add_dead_prota_sprite();
pacman.offset = 1;
pacman.currentoffset = 1;
currentmap = &map[0][0];

points_sp = add_points_sprite();
billboard = add_billboard_sprite();
Expand Down

0 comments on commit a553491

Please sign in to comment.