Commit Graph

28 Commits

Author SHA1 Message Date
hikerstk
aa74b59dcb Added separate fast-ping distance, so that the rubber ball
can start boucing lower/faster earlier, increasing the chances
to hit the target when target-distance is set to a small value.
Target-distance was set to 25 to decrease the chances of the
ball going through e.g. tunnel walls.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10004 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-16 21:18:45 +00:00
hikerstk
fbbb67d832 Removed unused variable.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10003 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-16 20:54:49 +00:00
hikerstk
830e88d1e5 Added maximum height difference to detect if a target is
close enough for a rubber ball. This avoids a problem is 
the target is actually close on a different part of the
track.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9996 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-16 12:17:56 +00:00
hikerstk
dbae2b0854 Fixed rubber balls sometimes disappearing under the track.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9949 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-06 22:19:44 +00:00
hikerstk
3c8d1e896a 1) Added a delete timer: if the ball has no target (e.g. fired by
player currently at front) it will disappear after a given
   time (atm 5 seconds).
2) If the ball overtakes the target it will now be deleted.
3) Fixed ball sometimes turning in the wrong direcftion when
   trying to hit a kart.
4) Some refactoring to make functions smaller.
5) Removed left-over debug code. 


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9945 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-05 21:27:21 +00:00
hikerstk
1246744be3 Restricted the angle the rubber ball can turn once
it is close to its target. This gives karts a chance
to escape a rubber ball by driving irretically.
Also added some debug output to indicate when the 
ball lost sight of its target (i.e. the ball was
going directly to a target, but then the target 
was suddenly too far away), so perhaps the ball
should be removed then?
ATM the ball will continue, trying again to hit
the leader in the next round.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9921 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-30 03:56:25 +00:00
auria
2311b11b90 Added new smart rescue
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9807 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-11 23:59:49 +00:00
hikerstk
8efe390c08 Made rubber ball debug output also available in non-debug
compilation.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9766 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-06 02:54:15 +00:00
hikerstk
13de49b5ee 1) Improved rubber ball handling, which should work better in tunnels
and inclines now.
2) Added --debug=flyable debug option to use print plenty of debug output
   for rubber balls (needs to be compiled with -DDEBUG to work).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9762 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-05 23:20:23 +00:00
hikerstk
fca446b974 Fixed #399: explode was called by cake and bowling,
even if the kart was immune. Now Flyable::hit()
returns true/false if the hit was a real hit.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9712 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-02 01:36:23 +00:00
hikerstk
d9f0b49e3b Missing file in previous commit.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9709 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-02 01:22:18 +00:00
hikerstk
a51597cdaf Refactoring: instead of flyable triggering explosions, this must now
be done from the hit function of the objects that need an explosion.
This makes flyable and the behaviour of flyables easier to understand
when reading the code, getting rid of the needsExplosion function.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9623 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-25 22:16:52 +00:00
hikerstk
f3355f2484 Refactored the 'hit strings' displayed in the gui. Now each
flyable object has to have a 'getHitString' function (instead
of the hard coded global functions like getBowlingString etc).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9622 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-25 22:02:29 +00:00
hikerstk
771cf47339 Refactoring: flyable and hit effects now call
updateAndDelete instead of update. The return
value indicates if the flyable/hit effect needs
to be deleted. That removes callbacks to the
projectile manager to indicate that something
needs to be deleted.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9619 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-25 00:06:33 +00:00
hikerstk
c0fbf21f8a Added bounce sound effect for rubber balls. For now(!) this
is just reusing the race-start 'ping', so this needs to be
replaced with a better sfx!!


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9598 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-21 21:56:49 +00:00
hikerstk
cb34118707 Made the minimum distance between interpolation control
points and the distance to target at which the rubber
ball starts aiming directly at the target configurable.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9550 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-18 03:31:52 +00:00
hikerstk
a6414b08b4 Rubber balls should now target the first kart again; improved handling
of the situation that the target kart is lost (e.g. it might have finished
the race), so that the ball smoothly aims at the new target now.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9547 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-17 23:06:48 +00:00
hikerstk
8a9bdc1505 Started to add interpolation to rubber balls to avoid them
changing directions too quickly.
This still needs more tuning. Known bugs:
1) at the beginning the ball changes directions too quick
   (if the kart is not close to the center of the driveline)
2) going towards the target kart (when the ball is close
   enough) has not been ported yet, so balls will more 
   often miss their targets.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9502 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-15 00:25:30 +00:00
hikerstk
6e5086f9b8 More refactoring: duplicated code handling track sectors and
distance along track is now moved into a separate class TrackSector
and used in linear_world and rubber ball.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9422 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-04 23:33:41 +00:00
hikerstk
428ed5a07b Made QuadGraph use a singleton-like behaviour. It is still created with
explicit calls to QuadGraph::create(...), and the get() function can
return NULL (in case of a race mode that does not use a quad graph).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9421 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-04 23:02:58 +00:00
hikerstk
95695d4264 Started to add data structures for interpolation, and added separate function
to determine which path to use (so that a target that is on a shortcut
can also be hit) - though this function atm only handles karts on the 
main driveline.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9417 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-03 06:56:49 +00:00
hikerstk
916dbb9bc1 Karts 'accidentally' hit by a bouncing ball while it is
going to catch if with the leader will now be flattened
(parameters for that are defined in powerup.xml). No
explosion effect is shown anymore for the first kart,
it will only be tossed around.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9369 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-26 06:58:11 +00:00
hikerstk
2c3e5395c6 Updated height and interval handling if the ball is getting
closer to the target. Now the ball behaviour keeps being
smooth while it is getting closer to the target.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9323 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-22 06:26:28 +00:00
hikerstk
c1d65112e7 Refqactoring: moved static rubber-ball specific settings from Flyable
to RubberBall.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9315 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-21 22:07:09 +00:00
hikerstk
4477862356 Improved bouncing of ball when it is still far away from the kart.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9314 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-21 06:58:28 +00:00
hikerstk
bf90805448 Added bouncing to rubber ball (though it's imho not
yet smooth enough).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9313 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-21 00:07:09 +00:00
hikerstk
b88a8da625 Fixed distance along track computation for rubber ball (which
was based on the quad it is aiming at, not at the quad it was on).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9310 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-20 22:21:44 +00:00
hikerstk
afb3728995 Added first test version of 'rubber ball' (which might replace
the anchor). Known bugs: atm it does not yet bounce (it follows
just the drivelines and might be partly in the track); the first
kart can't avoid it (long term breaking might allow you to avoid it);
it might hit another kart first and explode.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9302 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-07-20 00:39:32 +00:00