ID:153951
 
Well, on my 4K challenge project, I want to make vehicles to get from one place to another....faster.

Time is very important, so people will have to hurry from place to place, trying to beat other people.

Of course, there is the Driver class, and everything. But... I was wondering, how could I make the vehicles? (code-wise)

Should I make it an object that moves where the driver moves? But what about passengers? I have tried doing things like this before but they usually turn out bad, passengers tend to get lost, vehicle doesn't move, etc. Can any of you help me out?


-ST, still contemplating whether or not he should tell people about his game idea[s] for fear of theft.
Simple, just have /vehicle objects that work like this:

The first mob to enter the /vehicle becomes the driver.

vehicle/var/driver
driver = mob

That mob is also added to the contents of the vehicle. Any other mobs that enter the vehicle after that are simply added to the contents. When the exit the vehicle, they're moved to the vehicles location. If the mob also happens to be the driver when he exits, the driver status is passed onto the next mob in contents if there is one. Otherwise the driver becomes null.

When mobs enter the car, set their client eye to be outside the vehicle. I'm not sure how client eye works since I've never used it, but whenever the vehicle moves, set the client eyes of everyone in the contents to the vehicles new location. Make sure to set their client eyes to the vehicles location whenever they enter the vehicle.

Override the client controls to check and see if they are inside a vehicle when they use them. If they are, have it move the mob's location, not the mob. Since the mob is inside the vehicle, the vehicle is the mob's location.

That's about it.
In response to Foomer
Use client.perspective. Then you don't have to move client.eye ever movement.