alice-teacher First person shooter help

James Vanderhyde jvanderhyde at benedictine.edu
Fri Dec 20 14:58:17 EST 2013


I have an idea for this:

1. Create a bullet object. It doesn’t have to be visible for this game, I think, so it can be a dummy object. I used a bird from the Animals because it’s small and it can be seen during development.
2. Move and orient the bullet to the revolver. Set the vehicle property of the bullet to the revolver as well.
3. In the shoot method, move the bullet forward the distance to the desired object. Do this with duration 0 seconds so it happens instantly. If the revolver was pointing at the object, the bullet will be right on top of it. If the gun was pointing a little off, the object will be a little off. So:
4. Check the distance between the bullet and the object. If it’s within a threshold, the object should break. (I’m not sure how the student will make a breaking animation.)

I modified the file you sent as a proof of concept, but I can’t attach it to the email. You have to aim a little low for it to work.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/



On Dec 19, 2013, at 12:28 PM, Eric Hillstrom <ehillstrom at durango.k12.co.us<mailto:ehillstrom at durango.k12.co.us>> wrote:



-- Question and request for help form student.

I am making a game and cannot figure out how to make an object break when shot and  only when the revolver and object are aligned with a minimal +/- factor.

For example, the space bar fires the revolver.  Only when the revolver and lamp (object) are in near alignment should the lamp break when the revolver is fired.  The lamp should not break when fired and when not in alignment.  I will apply the problem to other objetcs in the world when solved how to do this.

See attached file names Shoot em Up.

Thanks

Dan




Eric Hillstrom
Teacher, CTE/Technology
Durango High School
970-259-1630 x2202
<Shoot em' Up.a2w>_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20131220/9149db0e/attachment.html 


More information about the alice-teachers mailing list