What is the enhancement in mind? How should it look and feel?
Please provide any additional information below.
1.booster and brake
We can use some equations below instead of constant speed.
for booster: speed = acceleration * ( 1.0 - speed / speed_max );
or for brake: speed = speed - acceleration; if(speed<speed_min) speed = speed_min;
normal track: speed =speed - acceleration; if(speed<0.0) speed = 0.0;
speed unchanged for power track because minecraft will speed up or slow down automatically.
And I found that a minecart on the slope seems to set its velocity to (0,0,0) when speed>0.8
The original method is use the Event"onVehicleDamage" ,and decide the direction by (Player).getLocation().getDirection(); But this vector changed only when players stop moving their mouse. If we punch the cart without stare at one point first ,the cart won't move to the direction we want.
Thus I found another function to improve the control. The function (Player).getVelocity() return vector when player move mouse or press key instantly.
So ,we can use this function in Event"onVehicleUpdate" to accelerate or decelerate minecart by press a key.
Similarly,we can use this function to implement intersection without stopping the minecart.For example , if we look forward and hold the key A ,the rail and cart will turn left ,then stop calling intersection function in the next cycle;And if player don't press any key or hold the key W ,the cart will keep the direction. But we still can change direction if we did't leave the intersection.And intersection should still work if we stop on the intersection by a T-shape intersection.
We can use this method to control a minecart which is not on the track.The minecart will become a racing car on the ground.And we can make jump function by (Player).isSneaking() ,etc.
- 1 comment
- Last updated
- May 28, 2012
- Apr 14, 2012
- Started - Work on this issue has begun.
- Enhancement - A change which is intended to better the project in some way
- Medium - Normal priority.