getting ready to activate engine on key

This commit is contained in:
Dan Ballard 2011-08-03 23:13:25 -07:00
parent 86b3849ee3
commit 3a3c66bba5
4 changed files with 19 additions and 6 deletions

View File

@ -22,8 +22,8 @@
; take 2 seconds to fully fire ; take 2 seconds to fully fire
(defmethod regen-model ((model engine-model) time) (defmethod regen-model ((model engine-model) time)
(setf (vertices model) (generate-step-2d-array *thruster-vertices* time)) (setf (vertices model) (generate-step-2d-array (template-vertices model) time))
(setf (colors model) (generate-step-2d-array *thruster-colors* time))) (setf (colors model) (generate-step-2d-array (template-colors model) time)))
(defparameter *thruster-vertices* (defparameter *thruster-vertices*

View File

@ -12,5 +12,6 @@
(:file "model") (:file "model")
(:file "physics") (:file "physics")
(:file "objects") (:file "objects")
(:file "engine")
(:file "flight-sim"))) (:file "flight-sim")))

View File

@ -248,9 +248,21 @@
(setf *num-frames* 0) (setf *num-frames* 0)
(setf *last-time* *start-time*) (setf *last-time* *start-time*)
(setf *controls-active* '()) (setf *controls-active* '())
(setf *self* (make-instance 'game-object (setf *self*
:body (make-instance 'body :coords (vector 0 0 11)) (make-instance
:model *ship-model*)) 'game-object
:body (make-instance 'body :coords (vector 0 0 11))
:model *ship-model*
:attachments
(list :thruster
(make-instance 'engine-object
:model (make-instance 'engine-model
:template-vertices *thruster-vertices*
:template-colors *thruster-colors*)
:body (make-instance 'body
:coords (vector 0 0 3)))))))
;:engines (list :engines (list :thrust ;:engines (list :engines (list :thrust
; (make-instance 'engine-object ; (make-instance 'engine-object
; :motion (make-instance 'motion :coords (vector 0 0.5 3.0)) ; :motion (make-instance 'motion :coords (vector 0 0.5 3.0))

View File

@ -14,7 +14,7 @@
(defmethod activate ((object game-object) sym start-time) (defmethod activate ((object game-object) sym start-time)
(push sym (active-attachments object)) (push sym (active-attachments object))
(activate (getf (attachments object) sym))) (activate (getf (attachments object) sym) start-time))
(defmethod draw :before ((object game-object) time) (defmethod draw :before ((object game-object) time)
(gl:push-matrix) (gl:push-matrix)