Grab the Ninjas.pdfJohnsCODE.pdfGIOSCODE.pdf6.111 – INTRODUCTORY SYSTEMS LABORATORY – FALL 2006 Grab the Ninjas! Final Project Report Giovanni Reveles and Chuan Zhang December 13, 2006 Grab the Ninjas! is an interactive video game in which players attempt to grab ninjas and drop them, thereby killing them and also avoid ninja stars thrown by the ninjas. A camera will detect player’s finger motions and transfer these onto the display. Ninjas will randomly appear on screen and move around. If a player makes a grabbing motion and the fingers are close to the ninja, the ninja will be grabbed and will be moved around at will. Whenever ninja stars hit the player fingers, the player will lose health, shown by a health bar. The game ends when the player loses all health. A two player version will also be implemented. Table of Contents I. Overview................................................................................................................................ 3 II. Video Modules (Chuan) ....................................................................................................... 4 A. Video Overall Design ........................................................................................................ 4 B. Color Video ....................................................................................................................... 6 C. Color Filtering Algorithm .................................................................................................. 6 D. Finger Detection Algorithm ............................................................................................. 8 E. Contact and Squeeze Detection Algorithm ..................................................................... 9 F. Video Overlay ................................................................................................................... 9 G. Video Overlay: Timing Issues ........................................................................................ 10 III Game Logic Modules .......................................................................................................... 11 A. Game Logic Module Overview ...................................................................................... 11 B. Enables ........................................................................................................................... 13 C. Ninja Control .................................................................................................................. 13 1. vsync ........................................................................................................................... 13 2. Moving ........................................................................................................................ 14 3. Grabbing/getting grabbed ......................................................................................... 14 4. Outputs ....................................................................................................................... 15 5. Jumping/Falling with gravity ..................................................................................... 16 C. Ninja Display ................................................................................................................... 19 E. Star Display ..................................................................................................................... 20 F. Health Display ................................................................................................................. 22 G. Ninja AI ........................................................................................................................... 23 IV. Testing and Debugging ..................................................................................................... 24 A. Video Modules (Chuan) ................................................................................................. 24 B. Game Logic Modules (Giovanni) .................................................................................... 24 IV. Conclusion ......................................................................................................................... 27 A. Video Modules Conclusion ............................................................................................ 27 B. Game Logic Modules Conclusion ................................................................................... 29 Table of Figures Figure 1 Video Module Block Diagram ..................................................................................... 5 Figure 2 Camera with Colored Fingers ...................................................................................... 7 Figure 3 Finger Detection Algorithm ........................................................................................ 8 Figure 4 Video Overlay ............................................................................................................ 10 Figure 5 Game Logic Module Block Diagram .......................................................................... 12 Figure 6 GRAB Internal FSM .................................................................................................... 15 Figure 7 JUMP Logic internal FSM........................................................................................... 17 Figure 8 ModelSim Wave Forms for Jump .............................................................................. 17 Figure 9 ModelSim Wave Form for Jump, (jump_DONE asserted High) ................................ 18 Figure 10 jump_DONE close up .............................................................................................. 18 Figure 11 Editing the Ninja Frames ......................................................................................... 19 Figure 12 Star Internal FSM .................................................................................................... 21 Figure 13 Star Display Wave Form .......................................................................................... 22 Figure 14 Star Wave Form 2 .................................................................................................... 22 Figure 15 Ninja AI Waveform .................................................................................................. 24 Figure 16 Game Screen w/out grabbing
View Full Document