public class CardGame extends GameGrid
GameGrid.ClosingMode
AskOnClose, bgColor, bgImagePath, bgImagePosX, bgImagePosY, BLACK, BLUE, cellSize, CYAN, DARKGRAY, DisposeOnClose, GRAY, GREEN, gridColor, LIGHTGRAY, MAGENTA, monitor, nbHorzCells, nbRotSprites, nbVertCells, NothingOnClose, PINK, RED, simulationPeriod, TerminateOnClose, TRANSPARENT, WHITE, YELLOW
Constructor and Description |
---|
CardGame()
Constructs the game playground with 10 by 10 cells (60 pixels wide).
|
CardGame(int width,
int height)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod)
with bgColor = RGB(20, 80, 0) (dark green), simulationPeriod = 30
and statusHeight = 0 (no status bar).
|
CardGame(int width,
int height,
java.awt.Color bgColor)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod)
with simulationPeriod = 30 and statusHeight = 0 (no status bar).
|
CardGame(int width,
int height,
java.awt.Color bgColor,
int statusHeight,
int simulationPeriod)
Constructs and shows a game grid window with the given horizontal and
vertical pixel size (cell size = 1, no navigation bar).
|
CardGame(int width,
int height,
int statusHeight)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod)
with bgColor = RGB(20, 80, 0) (dark green), simulationPeriod = 30.
|
act, actAll, activate, addActListener, addActor, addActor, addActor, addActorNoRefresh, addActorNoRefresh, addExitListener, addKeyListener, addKeyRepeatListener, addMouseListener, addNavigationListener, addResetListener, addStatusBar, addWindowStateListener, createTileMap, delay, dispose, doPause, doReset, doRun, doStep, getActors, getActors, getActorsAt, getActorsAt, getAreaSize, getBg, getBgColor, getBgImagePath, getBgImagePos, getBgImagePosX, getBgImagePosY, getCellSize, getClosingMode, getDiagonalLocations, getDoubleClickDelay, getEmptyLocations, getFrame, getGridColor, getImage, getKeyChar, getKeyCode, getKeyModifiers, getKeyModifiersText, getLineLocations, getMouseLocation, getNbCycles, getNbHorzCells, getNbHorzPix, getNbVertCells, getNbVertPix, getNumberOfActors, getNumberOfActors, getNumberOfActorsAt, getNumberOfActorsAt, getOccupiedLocations, getOneActor, getOneActorAt, getOneActorAt, getPaintOrderList, getPaintOrderList, getPanel, getPanel, getPgHeight, getPgWidth, getPosition, getPressedKeyCodes, getRandomDirection, getRandomEmptyLocation, getRandomLocation, getSimulationPeriod, getStackTrace, getTileMap, getTouchedActors, getVersion, hide, isActorColliding, isAtBorder, isDisposed, isEmpty, isInGrid, isKeyPressed, isPaused, isRunning, isShown, isTileColliding, isUndecorated, kbhit, paint, playLoop, playLoop, playLoop, playLoop, playLoopExt, playLoopExt, playSound, playSound, playSound, playSound, playSoundExt, playSoundExt, refresh, removeActor, removeActors, removeActorsAt, removeActorsAt, removeAllActors, removeKeyListener, removeKeyRepeatListener, removeMouseListener, reset, reverseSceneOrder, setActEnabled, setActOrder, setActorOnBottom, setActorOnTop, setBgColor, setBgColor, setBgImagePath, setBgImagePos, setBgImagePosX, setBgImagePosY, setCellSize, setClosingMode, setDoubleClickDelay, setGridColor, setKeyRepeatPeriod, setMouseEnabled, setNbHorzCells, setNbVertCells, setPaintOrder, setPosition, setSceneOrder, setSimulationPeriod, setStatusText, setStatusText, setTitle, shiftSceneOrder, show, showStatusBar, stopGameThread, toLocation, toLocation, toLocationInGrid, toLocationInGrid, toPoint
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
public CardGame()
CardGame cg = new CardGame();
cg.setCellSize(1);
cg.setNbHorzCells(600);
cg.setNbVertCells(600);
cg.setSimulationPeriod(30);
cg.setBgColor(new Color(20, 80, 0));
cg.doRun();
public CardGame(int width, int height)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowpublic CardGame(int width, int height, int statusHeight)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowstatusHeight
- the height of the status bar in pixels; if less or
equal zero, no status bar is displayedpublic CardGame(int width, int height, java.awt.Color bgColor)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowbgColor
- the background color of the game grid windowpublic CardGame(int width, int height, java.awt.Color bgColor, int statusHeight, int simulationPeriod)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowbgColor
- the background color of the game grid windowstatusHeight
- the height of the status bar in pixels; if less or
equal zero, no status bar is displayedsimulationPeriod
- the simulation period used for the simulation cycling