Permalink
Browse files

getting ready to activate engine on key

  • Loading branch information...
1 parent 86b3849 commit 3a3c66bba51bece8ed46f8cbe5fd85953886eaa5 @dballard committed Aug 4, 2011
Showing with 19 additions and 6 deletions.
  1. +2 −2 engine.lisp
  2. +1 −0 flight-sim.asd
  3. +15 −3 flight-sim.lisp
  4. +1 −1 objects.lisp
View
@@ -22,8 +22,8 @@
; take 2 seconds to fully fire
(defmethod regen-model ((model engine-model) time)
- (setf (vertices model) (generate-step-2d-array *thruster-vertices* time))
- (setf (colors model) (generate-step-2d-array *thruster-colors* time)))
+ (setf (vertices model) (generate-step-2d-array (template-vertices model) time))
+ (setf (colors model) (generate-step-2d-array (template-colors model) time)))
(defparameter *thruster-vertices*
View
@@ -12,5 +12,6 @@
(:file "model")
(:file "physics")
(:file "objects")
+ (:file "engine")
(:file "flight-sim")))
View
@@ -248,9 +248,21 @@
(setf *num-frames* 0)
(setf *last-time* *start-time*)
(setf *controls-active* '())
- (setf *self* (make-instance 'game-object
- :body (make-instance 'body :coords (vector 0 0 11))
- :model *ship-model*))
+ (setf *self*
+ (make-instance
+ '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
; (make-instance 'engine-object
; :motion (make-instance 'motion :coords (vector 0 0.5 3.0))
View
@@ -14,7 +14,7 @@
(defmethod activate ((object game-object) sym start-time)
(push sym (active-attachments object))
- (activate (getf (attachments object) sym)))
+ (activate (getf (attachments object) sym) start-time))
(defmethod draw :before ((object game-object) time)
(gl:push-matrix)

0 comments on commit 3a3c66b

Please sign in to comment.