Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / object angle y if under 90 and over 270

Author
Message
aks74u
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: arizona
Posted: 23rd Aug 2004 14:43
i was trying to make a liitle ai thingy where if you get too close
the other cube would move a way relative to the angle your are at.

if you are to the top of him he will move down and if you are to the
left he will go right and so on. any help would be tons of help. any other coding stuff would be much appreciated. thx!

Over And Out.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Aug 2004 15:02
so you wanna move away from the enemy?

"eureka" - Archimedes
aks74u
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: arizona
Posted: 25th Aug 2004 15:52
no i want the enemy to move away from me if i get too close

Over And Out.
Zokomoko
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 25th Aug 2004 16:00
Quote: "no i want the enemy to move away from me if i get too close
"


Pseudo code:
(1)check for distance, if distance is below a certain number, then do the following :
(a) point the AI object to the player
(b) move the AI object, use a negative speed so it will move backwards
aks74u
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: arizona
Posted: 25th Aug 2004 16:05
how do i keep my enemy position varibales updated then?

Over And Out.
Physics coder
20
Years of Service
User Offline
Joined: 25th May 2004
Location: United States
Posted: 25th Aug 2004 16:11
here's one way of doing it. basicly it finds the direction the enemy is in from the player, turns the ai away from the player, and moves the ai away, same type of thing could easily be done make the ai follow the player.



-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.
aks74u
20
Years of Service
User Offline
Joined: 2nd Jun 2004
Location: arizona
Posted: 26th Aug 2004 07:58
wow this is really cool. i just wondering if you could tell me what is doing what if its not too much. thx dude!

Over And Out.

Login to post a reply

Server time is: 2024-11-27 07:38:14
Your offset time is: 2024-11-27 07:38:14