The Daily Click ::. Forums ::. Daily Click ::. Team-mate shooting help
 

Post Reply  Post Oekaki 
 

Posted By Message

Daniel1992



Registered
  04/02/2009
Points
  5
1st April, 2009 at 12:41:04 -

Hi i need some help i want to make a npc witch following the "Hero" and when the enemy come near the team-mate gonna shoot at the enemy
My code is:

X position of "team-mate" <= X("Enemy")+100
-Set Global Value T to 1
X position of "team-mate" <= X("Enemy")-100
-Set Global Value T to 1
Y position of "team-mate" <= Y("Enemy")+100
-Set Global Value T to 1
Y position of "team-mate" <= Y("Enemy")-100
-Set Global Value T to 1
X position of "team-mate" > X("Enemy")+100
-Set Global Value T to 0
X position of "team-mate" > X("Enemy")-100
-Set Global Value T to 0
Y position of "team-mate" > Y("Enemy")+100
-Set Global Value T to 0
Y position of "team-mate" > Y("Enemy")-100
-Set Global Value T to 0
Global Value T = 1
+Every 01"-00
-Shoot "Bullet" at speed 100 toward (0,0) from "Team-mate"(at Enemy)


i don't know how to do it correctly..
Thanks in advance

Edited by Daniel1992

 
n/a

0ko



Registered
  11/01/2009
Points
  318
2nd April, 2009 at 01:20:54 -

Woah,you're not using seperate events are you?


Event 1:
x pos of enemy <+100 x pos of teammate
x pos of enemy >-100 x pos of teammate
y pos of enemy <+100 y pos of teammate
y pos of enemy >-100 y pos of teammate
Then : set alt value T to 1

Event 2:
x pos of enemy >+100 x pos of teammate
x pos of enemy <-100 x pos of teammate
y pos of enemy >+100 y pos of teammate
y pos of enemy <-100 y pos of teammate
Then : set alt value T to 0

That's how I always do it.

Edited by 0ko

 
n/a

Daniel1992



Registered
  04/02/2009
Points
  5
2nd April, 2009 at 11:22:13 -

Okay, i have fixed it now... thanks

 
n/a
   

Post Reply



 



Advertisement

Worth A Click