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 / Enemy movement

Author
Message
Dr Manette
19
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 1st May 2006 22:26 Edited at: 3rd May 2006 00:11
The last problem I have with my labriynth game is enemy movement. There will be a minatour released after a certain amount of time and I want it to follow your path through the maze until it collides with the character. It would kind of be a save camera path thing and having the object follow that path. What exactly should I do for this?

Bio Fox...four guys, one computer, games like nobody's business.
Classic Evil
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: watching you through your window
Posted: 2nd May 2006 05:10
you could save different cordinates of the movement so that the octopus can follow it from one point to another.

There are two types of people in this world: people who are extremly cool and are good at everything and people who are me.
Dr Manette
19
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 2nd May 2006 05:22 Edited at: 3rd May 2006 00:11
Hmm, that could work. Would I say, this point is a variable and this point is, and just move it to each? That seems to be an "infinate code problem" How can I continue to make new variables without making a new name for them every time? Arrays, maybe?

Bio Fox...four guys, one computer, games like nobody's business.
Classic Evil
19
Years of Service
User Offline
Joined: 4th Nov 2005
Location: watching you through your window
Posted: 2nd May 2006 05:27
just "re-write" the variable every time tha maze cactus with legs passes it to chase you.save the variable every once in a while. Think of it as a circle. save your position as v1 then v2 then v3 then v4 then v5 then v1 then v2 and so on.

There are two types of people in this world: people who are extremly cool and are good at everything and people who are me.
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 2nd May 2006 17:24
I worked up this code. If you have any questions about it, just ask.



Dr Manette
19
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 3rd May 2006 00:00 Edited at: 3rd May 2006 01:17
dabip, that code is almost exactly what I need! If it's possible, could you make the same thing except that the view is first person and the sphere follows the camera after a period of time? Also, the objects were shakey, any reason why? If you can write the code, we can put you in the credits of the game. It'll be up on our website, http://www.theducttapeclub.org (don't ask about the url name, the company is Bio Fox) Thanks again!

-----EDIT-----
I made what I wanted myself. I used some of your code, dabip, and enter some of my own.

The one problem I have is that the camera has to be facing the object at all times. When I rem this, it gets messed up. Is there any way to have free movement without having a forced view towards the object?

Bio Fox...four guys, one computer, games like nobody's business.
Dr Manette
19
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 3rd May 2006 02:38 Edited at: 3rd May 2006 02:41
For some reason, that small problem has worked itself out. There still is a problem with my code, however. everything works fine except when I make the object, the camera position reverts to 0,0,0 for some reason. This code won't work on your computer, but I wanted to show what goes wrong:

If anyone can tell me why, that would be great. Also, once that is fixed, how can I make the object "know the map" and avoid walls while still coming towards the camera? It would know the shortest route to the player too, I guess.

Bio Fox...four guys, one computer, games like nobody's business.
Dr Manette
19
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 4th May 2006 01:04 Edited at: 4th May 2006 01:05
Scratch that idea above. What I want the enemy to do is go along the maze and keep within the walls. This means checking static box collision, which kind of works the way I have it. Here is an example:

The problem I have is that when the plain is traveling along the x axis rather than the z, the plain will go the opposite way it came. Could someone try and fix this or help me out. A suggestion for a better way is also welcome!

Bio Fox...four guys, one computer, games like nobody's business.

Login to post a reply

Server time is: 2025-05-23 16:54:45
Your offset time is: 2025-05-23 16:54:45