Thread: [TuxKart-devel] Keyboard works!
Status: Alpha
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2000-07-02 22:32:27
|
The latest version of TuxKart in CVS can be played without a joystick using
the keyboard.
Dynamic key bindings will come in due course - but for now, the key assignments
are:
LEFT/RIGHT ARROW: Steer.
UP-ARROW - Same as 'A' button - Accellerate
DOWN-ARROW - Same as 'B' button - Brake
ENTER - Same as 'C' button - Use an item
A key - Same as 'L' button - pop a Wheelie
S key - Same as 'R' button - Jump
D key - Same as 'D' button - Unused
SPACE - Pop up or Hide the menu bar.
R key - Restart the race.
P key - Pause.
X key - Exit the game.
ESCAPE- Exit the game.
Mouse control coming soon!
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Norman V. <nh...@ca...> - 2000-07-02 22:53:03
|
Steve Baker writes: > >The latest version of TuxKart in CVS can be played without a >joystick using the keyboard. Great ! < snip > FWIW I could probably port the FlightGear Mouse Logic easily: - right button rotates between pointer, yoke and view mode in yoke mode - horizontal drag with no buttons moves ailerons - vertical drag with no buttons moves elevators - horizontal drag with left button moves brakes (left=on) - vertical drag with left button moves throttle (up=more) - horizontal drag with middle button moves rudder - vertical drag with middle button moves trim When In view mode view View follows mouse deviation from center point of screen. Left click will reposition the mouse to screen center point and place view into normal straight-ahead mode. Norman |
|
From: Steve B. <sjb...@ai...> - 2000-07-02 23:08:29
|
Norman Vine wrote:
>
> Steve Baker writes:
> >
> >The latest version of TuxKart in CVS can be played without a
> >joystick using the keyboard.
>
> Great !
>
> < snip >
>
> FWIW
>
> I could probably port the FlightGear Mouse Logic easily:
Thanks for the offer - but it's only going to be a handful
of lines of code - the worst part is always tuning the
sensitivity to make it playable with the same 'feel' as
the joystick version.
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Norman V. <nh...@ca...> - 2000-07-03 04:00:29
|
Hi All
Two minor changes to get CYGWIN working with CVS files
-see below-
Also were the images and sound files commited to CVS
as binary files ?
If not they should be recomitted with the -b flag.
I had to use the ones from the tarball as the CVS
versions appeared to be corrupted on Win32.
I know --
the text - binary file distinction is a Windows feature
that programers working on real operating systems
should not have to concern themselves with :-)
Cheers
Norman
1) start_tux.h
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef WIN32
+ #ifdef __CYGWIN__
+ #include <unistd.h>
+ #endif
#include <windows.h>
#else
#include <unistd.h>
#endif
2) gfx.cxx -- initWindow(int w, int h)
void initWindow ( int w, int h )
{
/*
Already done in start_tuxkart
int fake_argc = 1 ;
char *fake_argv[3] ;
for ( int i = 0 ; i < 512 ; i++ )
keyIsDown [ i ] = FALSE ;
fake_argv[0] = "Tux Kart" ;
fake_argv[1] = "Tux Kart by Steve Baker." ;
fake_argv[2] = NULL ;
glutInitWindowPosition ( 0, 0 ) ;
glutInitWindowSize ( w, h ) ;
glutInit ( &fake_argc, fake_argv ) ;
glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ;
glutCreateWindow ( fake_argv[1] ) ;
*/
glutDisplayFunc ( tuxKartMainLoop ) ;
glutKeyboardFunc ( getGLUTKeystroke ) ;
glutSpecialFunc ( getGLUTSpecialKeystroke ) ;
glutKeyboardUpFunc ( getGLUTUpKeystroke ) ;
glutSpecialUpFunc ( getGLUTUpSpecialKeystroke ) ;
glutReshapeFunc ( reshape ) ;
glutIdleFunc ( glutPostRedisplay ) ;
}
|
|
From: Steve B. <sjb...@ai...> - 2000-07-03 23:21:01
|
Norman Vine wrote:
> Also were the images and sound files commited to CVS
> as binary files ?
Not explicitly - I don't think I need to do that on
'poper' OS's.
> If not they should be recomitted with the -b flag.
I tried that and I got a very strange set of error
messages - so I did a 'man cvs' and searched for '-b' to check
out exactly what it meant and there are several occurrances of it:
1) As a 'main' option:
"-b bindir: Use bindir as the directory where RCS programs
are located (CVS 1.9 and older). Overrides the setting
of the RCSBIN environment variable. This value
should be specified as an absolute pathname."
2) As a sub-option of 'tag', 'rtag':
"The -b option makes the tag a ``branch'' tag,
allowing concurrent, isolated development. This is
most useful for creating a patch to a previously
released software distribution."
3) As a sub-option of 'history':
"-b str: Show data back to a record containing the string
str in either the module name, the file name, or
the repository path."
4) As a sub-option of 'import':
"Use `-b branch' to specify a first-level branch
other than `1.1.1'."
None of those appear to force things to be binary files.
Weird.
> I had to use the ones from the tarball as the CVS
> versions appeared to be corrupted on Win32.
Hmmm - I immediately did a CVS download after I made
the repository, did a 'diff' against my existing files
and removed my originals once I was confident that they
were correctly in CVS. So it MUST be some kind of binary/ascii
thing.
Do you have any other ideas what the appropriate option might be.
> I know --
> the text - binary file distinction is a Windows feature
> that programers working on real operating systems
> should not have to concern themselves with :-)
Grrr!
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Norman V. <nh...@ca...> - 2000-07-03 23:42:44
|
Steve Baker wrote: > >Norman Vine wrote: > >> Also were the images and sound files commited to CVS >> as binary files ? > >> If not they should be recomitted with the -b flag. MY BAD that should read -kb From CVS book CVS And Binary Files Until now, I've left unsaid the dirty little secret of CVS, which is that it doesn't handle binary files very well (well, there are other dirty little secrets, but this definitely counts as one of the dirtiest). It's not that CVS doesn't handle binaries at all; it does, just not with any great panache. All the files we've been working with until now have been plain text files. CVS has some special tricks for text files. For example, when it's working between a Unix repository and a Windows or Macintosh working copy, it converts file line endings appropriately for each platform. For example, Unix convention is to use a linefeed (LF) only, whereas Windows expects a carriage return/linefeed (CRLF) sequence at the end of each line. Thus, the files in a working copy on a Windows machine will have CRLF endings, but a working copy of the same project on a Unix machine will have LF endings (the repository itself is always stored in LF format). Another trick is that CVS detects special strings, known as RCS keyword strings, in text files and replaces them with revision information and other useful things. For example, if your file contains this string $Revision$ CVS will expand on each commit to include the revision number. For example, it may get expanded to $Revision: 1.3 $ CVS will keep that string up to date as the file is developed. (The various keyword strings are documented in Advanced CVS and Third-Party Tools.) This string expansion is a very useful feature in text files, as it allows you to see the revision number or other information about a file while you're editing it. But what if the file is a JPG image? Or a compiled executable program? In those kinds of files, CVS could do some serious damage if it blundered around expanding any keyword string that it encountered. In a binary, such strings may even appear by coincidence. Therefore, when you add a binary file, you have to tell CVS to turn off both keyword expansion and line-ending conversion. To do so, use -kb: floss$ cvs add -kb filename floss$ cvs ci -m "added blah" filename (etc) |
|
From: Steve B. <sjb...@ai...> - 2000-07-04 01:27:47
|
Norman Vine wrote:
>
> Steve Baker wrote:
> >
> >Norman Vine wrote:
> >
> >> Also were the images and sound files commited to CVS
> >> as binary files ?
> >
> >> If not they should be recomitted with the -b flag.
>
> MY BAD that should read -kb
Aha! I would have found that if I'd had the common sense to search
for 'binary' in the man page...but then it *is* Monday. :-)
<snip>
> Therefore, when you add a binary file, you have to tell CVS to turn off both
> keyword expansion and line-ending conversion. To do so, use -kb:
>
> floss$ cvs add -kb filename
> floss$ cvs ci -m "added blah" filename
> (etc)
Ack! I have to 'add' the file to do it! That means I first
have to 'remove' the file - and it won't do that unless I really
do remove the file...(or at least move it somewhere else!)
OK - well I'm on the case. Give me a day or so - I have lots of
stuff edited but not compiled that I don't want to check in right
now.
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Bram S. <br...@ch...> - 2000-07-04 06:37:28
|
Norman Vine wrote:
> Therefore, when you add a binary file, you have to tell CVS to turn off both
> keyword expansion and line-ending conversion. To do so, use -kb:
>
> floss$ cvs add -kb filename
> floss$ cvs ci -m "added blah" filename
> (etc)
>
I usually use a CVSROOT file to specify the binary nature of files only
once for each extention.
You could add something like this to CVSROOT/cvswrappers
Note that I have uppercase variants in case window$ users
put something in cvs. Ugly.
The CVSROOT is updatable via cvs itself also. You do not need access
to the cvs server machine itself.
Bram
--- cut here ----
*.jpg -k 'b'
*.JPG -k 'b'
*.tif -k 'b'
*.tiff -k 'b'
*.TIF -k 'b'
*.TIFF -k 'b'
*.bmp -k 'b'
*.BMP -k 'b'
*.gif -k 'b'
*.GIF -k 'b'
*.wav -k 'b'
*.WAV -k 'b;
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Bram Stolk "Linux - Why use windows, if there is a door?"
work: br...@sa...
priv: br...@ch...
|
|
From: Norman V. <nh...@ca...> - 2000-07-04 06:46:59
|
Bram Stolk writes: > >Norman Vine wrote: > >> Therefore, when you add a binary file, you have to tell CVS >to turn off both >> keyword expansion and line-ending conversion. To do so, use -kb: >> > > >I usually use a CVSROOT file to specify the binary nature of files only >once for each extention. > Much better ! Thanks for pointing this one out :-) Norman |
|
From: Steve B. <sjb...@ai...> - 2000-07-05 00:04:32
|
Norman Vine wrote:
>
> Bram Stolk writes:
> >
> >Norman Vine wrote:
> >
> >> Therefore, when you add a binary file, you have to tell CVS
> >to turn off both
> >> keyword expansion and line-ending conversion. To do so, use -kb:
OK - the CVS archive should now be set up correctly.
(With a bunch of new code and some bug fixes...check out the 'D'
button!)
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Norman V. <nh...@ca...> - 2000-07-05 03:33:17
|
Steve Baker writes: > >OK - the CVS archive should now be set up correctly. The binary files from CVS seem to work fine :-) >(With a bunch of new code and some bug fixes...check out the 'D' >button!) I am a butterfly -- Whee !! Norman |
|
From: Steve B. <sjb...@ai...> - 2000-07-05 04:15:44
|
Norman Vine wrote:
> The binary files from CVS seem to work fine :-)
Excellent.
> I am a butterfly -- Whee !!
Erm, yes - now sit down and try to relax - I'm going to phone
those *nice* guys in the white coats with the strait jacket.
:-)
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|
|
From: Bram S. <br...@ch...> - 2000-07-03 17:02:22
|
Steve Baker wrote: > > The latest version of TuxKart in CVS can be played without a joystick using > the keyboard. Nice! I just finished as 3rd :-) I like the sponsoring on the billboards. And I wonder, do we hear Steve himself exclaiming 'ow' when you hit your competitor? On a side note: the problem with a seperate builddir is caused by the $(wildcard *.wav) construction. The experts at the automake mailinglist told me that wildcards should not be used in .am files. However, I don't think that listing your installable files is an option. It's too easy to forget listing new additions. So I think you can forget about the 'Right Thing', it probably doesn't exist here. Bram -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Bram Stolk "Linux - Why use windows, if there is a door?" work: br...@sa... priv: br...@ch... |
|
From: Steve B. <sjb...@ai...> - 2000-07-04 00:31:02
|
Bram Stolk wrote:
>
> Steve Baker wrote:
> >
> > The latest version of TuxKart in CVS can be played without a joystick using
> > the keyboard.
>
> Nice!
> I just finished as 3rd :-)
>
> I like the sponsoring on the billboards.
>
> And I wonder, do we hear Steve himself exclaiming 'ow' when
> you hit your competitor?
Close - my son, Oliver does the voices...we are currently recording
spoken phrases for people to say as they pass you.
"Byeee!"
"Coming through!"
"Eat my dust!"
...and so on.
A 9yr old kids' voice sounds more like a penguin should sound IMHO.
> On a side note: the problem with a seperate builddir is
> caused by the $(wildcard *.wav) construction. The experts
> at the automake mailinglist told me that wildcards should
> not be used in .am files. However, I don't think that listing
> your installable files is an option. It's too easy to forget
> listing new additions. So I think you can forget about the 'Right Thing',
> it probably doesn't exist here.
Ack! Point well taken.
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|