;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;; PHYSICS ENGINE ;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.include "../man/man_game.h.s"
.include "../man/man_entity.h.s"

screen_width = 80
screen_height = 200

phisycs_cmps = e_cmps_physics

physics_update_entity::
    ld      a, e_posx(ix)       ;;
    add     e_vx(ix)            ;;  ENTITY.x += Entity.vx
    ld      e_posx(ix),  a      ;;

    ld      a, e_posy(ix)       ;;
    add     e_vy(ix)            ;;  ENTITY.x += Entity.vx
    ld      e_posy(ix),  a      ;;
ret

physics_update::

    ld de, #(e_cmps_physics)
    ld hl, #physics_update_entity       ;;TESTING
    call man_entity_for_all_matching
ret