001         package com.croftsoft.apps.road;
002    
003         import java.awt.*;
004    
005         import com.croftsoft.core.CroftSoftConstants;
006    
007         /*********************************************************************
008         * CroftSoft Roadrunner constants.
009         *
010         * @version
011         *   2003-11-09
012         * @since
013         *   2003-08-05
014         * @author
015         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
016         *********************************************************************/
017    
018         public interface  Constants
019         //////////////////////////////////////////////////////////////////////
020         //////////////////////////////////////////////////////////////////////
021         {
022    
023         public static final String  VERSION
024           = "2003-11-09";
025    
026         public static final String  TITLE
027           = "CroftSoft Roadrunner";
028    
029         public static final String  APPLET_INFO
030           = "\n" + TITLE
031           + "\n" + "Version " + VERSION
032           + "\n" + CroftSoftConstants.COPYRIGHT
033           + "\n" + CroftSoftConstants.DEFAULT_LICENSE
034           + "\n" + CroftSoftConstants.HOME_PAGE
035           + "\n";
036    
037         //////////////////////////////////////////////////////////////////////
038         // frame constants
039         //////////////////////////////////////////////////////////////////////
040    
041         public static final String  FRAME_TITLE
042           = TITLE;
043    
044         public static final String  FRAME_ICON_FILENAME
045           = "/images/croftsoft.png";
046           
047         public static final Dimension  FRAME_SIZE
048           = new Dimension ( 600, 400 );
049    
050         public static final String  SHUTDOWN_CONFIRMATION_PROMPT
051           = "Close " + TITLE + "?";
052    
053         //////////////////////////////////////////////////////////////////////
054         // animation constants
055         //////////////////////////////////////////////////////////////////////
056    
057         /** frames per second */
058         public static final Double  FRAME_RATE = new Double ( 85.0 );
059    
060         public static final Color   BACKGROUND_COLOR
061           = new Color ( 0, 100, 0 );
062    
063         public static final Color   FOREGROUND_COLOR
064           = Color.BLACK;
065    
066         public static final Font    FONT
067           = new Font ( "Arioso", Font.BOLD, 10 );
068    
069         public static final Cursor  CURSOR
070           = new Cursor ( Cursor.CROSSHAIR_CURSOR );
071    
072         public static final String  MEDIA_DIR = "media/road/";
073    
074         //////////////////////////////////////////////////////////////////////
075         // tile constants
076         //////////////////////////////////////////////////////////////////////
077    
078         public static final byte  TILE_TYPE_DIVIDER  = 0;
079    
080         public static final byte  TILE_TYPE_GRASS    = 1;
081    
082         public static final byte  TILE_TYPE_ROAD     = 2;
083    
084         public static final byte  TILE_TYPE_SHOULDER = 3;
085    
086         public static final byte  TILE_TYPE_WALL     = 4;
087    
088         public static final int   TILE_TYPES         = 5;
089    
090         //
091    
092         public static final String [ ]  TILE_IMAGE_FILENAMES
093           = new String [ ] {
094           "divider",
095           "grass",
096           "road",
097           "shoulder",
098           "wall" };
099    
100         public static final String  ENEMY_IMAGE_FILENAME  = "enemy";
101    
102         public static final String  RUNNER_IMAGE_FILENAME = "runner";
103    
104         public static final String  IMAGE_FILENAME_EXTENSION = ".png";
105    
106         //
107    
108         public static final int  TILE_SIZE = 40;
109    
110         public static final Dimension  TILE_DIMENSION
111           = new Dimension ( TILE_SIZE, TILE_SIZE );
112    
113         public static final int  TILE_AREA_WIDTH = 15 * TILE_SIZE;
114    
115         /** pixels per frame */
116         public static final int  ROAD_RATE = -2;
117    
118         public static final double  TIME_DELTA_MAX = 0.1;
119    
120         /** pixels per second */
121         public static final double  RUNNER_VELOCITY = 2 * TILE_SIZE;
122    
123         /** pixels per second */
124         public static final double  ENEMY_VELOCITY  = RUNNER_VELOCITY;
125    
126         //////////////////////////////////////////////////////////////////////
127         //////////////////////////////////////////////////////////////////////
128         }