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.

DarkBASIC Discussion / Objects walking towards player?

Author
Message
Bloder
17
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 23rd Aug 2009 00:52
Hi, I'm making a game and basically, the player is in a room with loads of enemies coming at him, but they are coming one at a time.
How do I get the enemy (object 3) to move towards the player (Object 1) while moving along a flat matrix.

Basically, all I want to know is how to make objects move from where they start and follow the player until they hit them.

Am I confusing you too much? Either post the answer to my question or post a message saying that I'm a complete and utter loonatic who doesn't know what he's saying.

If I were you, I'd make a game...
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Aug 2009 01:18
Try:

Point object
Move object


TheComet


Make the paths of your enemies easier with WaypointPro!
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Aug 2009 01:32
also you will need to find the x,y,z coords of the player, so either store the players coords into variables, or use the object position x(), object position y(), and object position z() functions

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Aug 2009 01:35 Edited at: 23rd Aug 2009 01:36
You can of course lock the enemy to only moving on the x and z axis, for that you point object to the player, move it, and add this after those steps:

position object <enemy>,object position x(<enemy> ),<position y>,object position z(<enemy> )

This makes it so the enemy will not float in the air when you go up onto things, but stick to the ground.

TheComet


Make the paths of your enemies easier with WaypointPro!
Bloder
17
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 23rd Aug 2009 11:56
Thanks

If I were you, I'd make a game...

Login to post a reply

Server time is: 2024-05-09 05:16:31
Your offset time is: 2024-05-09 05:16:31