Commit Graph

44 Commits

Author SHA1 Message Date
hiker
27b5409487 Use ticks (at the physics frame rate) for time measurement, which
avoids potential floating point errors (in networking).
2018-02-21 22:18:45 +11:00
hiker
1b75ed9b4c First fix for the basket-ball in cannon - make the ball follow
the cannon.
2017-05-12 17:11:46 +10:00
Benau
eeac5668d9 Rename QuadGraph to DriveGraph, make it use the new Graph interface 2016-09-17 14:30:28 +08:00
Benau
6dc05a1ec7 Merge remote-tracking branch 'origin/master' into walldriving 2016-04-08 13:42:58 +08:00
hiker
8d07d26c25 Updated (c) year to include 2015. 2015-03-30 11:42:50 +11:00
nixt
2673e59844 Fix a bug where the rubber ball would collide with the ceiling in a tunnel. 2014-07-23 20:00:15 +05:30
Marianne Gagnon
3d054ea91b Bunch of small code cleanup 2014-01-25 21:05:07 -05:00
hikerstk
05607e862e Goodbye hit messages (note: I had to rebuild from scratch
to avoid some strange crashes).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14581 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-11-27 21:43:34 +00:00
hikerstk
c5b8732087 Probably biggest commit (in terms of number of files) ever -
updated the (c) line of all files to -2013, added missing (c), 
changed format in some cases so that it will be easier in
the future to change them by script. No actualy code change.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14447 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-11-15 11:43:21 +00:00
curaga
57c3cbae3e Space cleanup pass on the headers
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12817 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-05-30 19:47:39 +00:00
hikerstk
7ab65aee16 Fixed #879: avoid too many basket balls at the same time by introducing
a minimum amount of time (atm 15 seconds) before the next basket ball
can be found. Thanks to nixt for the patch.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12722 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-05-03 06:48:47 +00:00
hikerstk
ebbc1a71d8 Introduced an 'abstract kart' class, which is used to
de-couple kart implementation and its interface. This
significantly reduces compile time when changing kart.hpp,
but is at this stage still work in progress.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10997 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-03-19 20:21:11 +00:00
auria
92eb0ebd2a Ran a small bash script to remove all of those annoying strings. The only thing they gave us were the need to rebuild after committing
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10363 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-06 18:43:36 +00:00
hikerstk
3f96f3529b Rubber ball will now detect tunneling and try to avoid it
(if a ball tunnels four times in a row it is removed).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10041 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-25 20:48:36 +00:00
hikerstk
b9e4325560 Added 'early targeting': the rubber ball will align its relative position
to the center of the track according to the relative distance of its target
(more precisely: it will move the interpolation control points). This
results in the ball being better align when it switches to aim-directly-at-
target mode, meaning that the target-distance can be reduced, hopefully
reducing the frequency with which tunneling happens.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10016 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-18 20:14:03 +00:00
hikerstk
55cb9941b5 A rubber ball hit is now a proper explosion (i.e. it also affects
other karts close by), and the hit message is shown (we need
better hit messages for rubber balls ;) ).
Renamed checkDistanceToTarget() to updateDistanceToTarget.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10005 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-17 06:07:44 +00:00
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