;;####################################################################
;;# GNU Free Documentation License                                   #
;;# Version 1.3, 3 November 2008                                     #
;;#                                                                  #
;;# Copyright (C) 2021 Lumina                                        #
;;# (Paula Garcia Morales, Laura Gil Lopez, Jorge Perez Dominguez)   #
;;#                                                                  #
;;# Everyone is permitted to copy and distribute verbatim copies     #
;;# of this license document, but changing it is not allowed.        #
;;####################################################################


.include "cpctelera.h.s"
.include "level.h.s"

Ch1Level:: .db 49  ;;1
Ch2Level:: .db 45  ;;-
Ch3Level:: .db 49  ;;1



level_init::
    call paint_level
ret

reset_level::
    ld a, #49
    ld (Ch1Level), a

    ld a, #45
    ld (Ch2Level), a

    ld a, #49
    ld (Ch3Level), a
ret

next_level::
    ld (Ch3Level), a
ret

next_world::
    ld (Ch1Level), a
ret

paint_level::
    ld bc, #0x0811  ;;y(8)x(17)
    ld a, (Ch1Level)

    call render_lifes_clock_levels

    ld bc, #0x0813  ;;y(8)x(19)
    ld a, (Ch2Level)

    call render_lifes_clock_levels

    ld bc, #0x0815  ;;y(8)x(21)
    ld a, (Ch3Level)

    call render_lifes_clock_levels
ret