Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void archerIA(mage_t *mage,archer_t *archer,queue_t *fireball){
- if(archer->x > mage->x){
- archer->direction=-1;
- }else{
- archer->direction=1;
- }
- if(archer->direction=-1){
- if(archer->x - mage->x < 400){
- archer->speed = 1;
- archer->direction=1;
- }else if(archer->x - mage->x > 650){
- archer->speed= 1;
- archer->direction = -1;
- }else{
- archer->speed = 0;
- archer->attack = 1;
- archer->frame = game_animation_frame(archer->startTime,5,1000,5);
- }
- }else{
- if(mage->x - archer->x < 400){
- archer->speed = -1;
- archer->direction= -1;
- }else if(mage->x - archer->x > 650){
- archer->speed = 1;
- archer->direction = 1;
- }else{
- archer->speed = 0;
- archer->attack = 1;
- archer->frame = game_animation_frame(archer->startTime,5,1000,5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement