Fix physics engine

This commit is contained in:
nephryte 2024-05-26 01:00:52 -04:00
parent f5398d0847
commit 32b288c1df

View file

@ -1,14 +1,14 @@
(define-module (ces system tilemap-renderer) (define-module (ces system physics-engine-2d)
#:pure #:pure
#:use-module (scheme base) #:use-module (scheme base)
#:use-module (math vector) #:use-module (math vector)
#:use-module (ces system) #:use-module (ces system)
#:use-module (ces component) #:use-module (ces component)
#:use-module (ces entity) #:use-module (ces entity)
#:export (create-physics-engine)) #:export (create-physics-engine-2d))
;(define desired-components '('imass 'position 'velocity 'acceleration)) ;(define desired-components '('imass 'position 'velocity 'acceleration))
(define desired-components '('position 'velocity 'acceleration)) (define desired-components '('hitbox 'position 'velocity 'acceleration))
(define (wants-entity? entity) (define (wants-entity? entity)
(and (game-entity? entity) (and (game-entity? entity)
@ -36,7 +36,7 @@
;; reset entity ;; reset entity
(reset-entity! (get-entity-manager) updated-entity))))) (reset-entity! (get-entity-manager) updated-entity)))))
(define (create-physics-engine) (define (create-physics-engine-2d)
(create-system wants-entity? (create-system wants-entity?
(lambda (entity dt) (lambda (entity dt)
(update-physics-entity entity dt)))) (update-physics-entity entity dt))))