Overview‎ > ‎

AI Kid

AI Kid :

This is a demonstration about :
    - Algorithm to dodge bullets
    - The bullets may come from up & down , left & right
    - Bullets have various velocities
    - Radar & Trace system

AI_kid20090802s.zip


Control :

Arrow Key : Direction control
[X] : Speed up
[A] : Text Bullet
[S] : Cast a missile
[ESC] : Exit

Dodge Algorithm :
1. Check & record all the positions of bullets in this scene.
2. Calculate the speed(include velocity & vector) of bullets.
3. Calculate which bullet will hit the AI Kid first.
4. Dodge the bullet base on the hit timing & the movement of AI Kid.
5. Decide the dodging direction base on the movement vector of bullet.

Missile Tracing :
1. Detect the position of target.
2. Change the speed of missile base on the target position by time .

Radar :
1. Show the position of AI Kid & Missile.

Note :
For dodging the different types of objects , it is a good idea to resister
all of them into one table(or matrix). In this case , it only needs one
loop ( like for(int i=0 ; i < ObjMax_No ; i++) {...Matrix(i,x,y);...} ) to
finish the position checking.


Copyright © 2007 bdragon All rights reserved.
bdragong@gmail.com
WebRep
Overall rating
 
ċ
Bdragon Ho,
Aug 2, 2009, 11:34 PM
Comments