public class Main
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static Board |
board
The board (map) of the game
|
static Camera |
camera
The camera that follows Sonic
|
static boolean |
CHAT_PANEL_ON
Global flag to turn the chat panel on/off
|
static ChatPanel |
chatPanel
The chat panel
|
ControlScreen |
controlScreen
The controls screen
|
static int |
curFrames
Counts the current frames
|
static int |
curMinutes
Displays the minutes in the HUD
|
static int |
currentStage
The current stage Sonic is on
|
static int |
curSeconds
Stores the seconds that passed during the game
|
static int |
curSeconds1
Displays the tens digit for the seconds in the HUD
|
static int |
curSeconds2
Displays the ones digit for the seconds in the HUD
|
DeathScreen |
deathScreen
The death screen
|
EndCreditScreen |
endCreditScreen
The end credit screen
|
EndScreen |
endScreen
The end screen
|
static int |
focusedPanel
States which panel is in focus
|
static double |
FPS
The frames per second of the game
|
static javax.swing.JFrame |
frame
The main window of the game
|
static java.awt.Graphics |
g
Stores the instance of the Graphics object
|
static boolean |
gameOver
Identifies if the game has ended
|
static Main |
gamePanel
The window that shows the game
|
static boolean |
gameStart
Identifies if the game has started
|
static GameState |
gameState
Stores the current game state
|
static int |
H
The height of the window
|
static Hud |
hud
The HUD displayed to the users
|
static boolean |
INV_IMAGE_PANEL_ON
Global flag to turn the GUI inventory panel on/off
|
static boolean |
INV_PANEL_ON
Global flag to turn the text-based inventory panel panel on/off
|
static InventoryImagePanel |
invImagePanel
The GUI inventory panel
|
static InventoryPanel |
invPanel
The text-based inventory panel
|
static boolean |
isLoading
Identifies if the game is loading
|
static Item |
itemPickedUp
Stores the item has been picked up from the inventory panel
|
static int |
itemPickedUpCol
Stores the source slot col
|
static int |
itemPickedUpFrom
Stores the source slot number
|
static int |
itemPickedUpRow
Stores the source slot row
|
boolean |
levelCompleted
Identifies if a stage has been completed
|
static boolean |
LOGIN_PANEL_ON
Global flag to turn the login panel on/off
|
static LoginPanel |
loginPanel
The login panel
|
MapScreen |
mapScreen
The map (stage) screen
|
Menu |
menu
The menu screen
|
static boolean |
MULTIPLAYER_ON
Global flag to turn the multiplayer on/off
|
HandleSoundFx |
musicObject
Manages the music and sound effects of the game
|
java.awt.image.BufferedImage |
newImage
Stores the images of the game
|
static int |
PANEL_INV
States that the inventory panel is in focus
|
static int |
PANEL_NONE
States that neither the inventory or the shop panel is in focus
|
static int |
PANEL_SHOP
States that the shop panel is in focus
|
static java.util.Random |
r
Produces randomly generated numbers
|
static java.lang.String |
SERVER_IP_ADDRESS
Stores the localhost IP address
|
static boolean |
SHOP_IMAGE_PANEL_ON
Global flag to turn the GUI shop panel on/off
|
static boolean |
SHOP_PANEL_ON
Global flag to turn the text-based shop panel on/off
|
static ShopImagePanel |
shopImagePanel
The GUI shop panel
|
static ShopPanel |
shopPanel
The text-based shop panel
|
static boolean |
showHitbox
Toggleable flag to show hitboxes of game objects
|
static boolean |
SOUND_ON
Global flag to turn the sound on/off
|
static SplashScreen |
splashScreen
Manages screens when they are fading out
|
static int |
TIMER_DELAY
The timer delay to update each frame
|
static boolean |
TITLE_SCREEN_ON
Global flag to turn the title screen on/off
|
TitleScreen |
titleScreen
The title screen
|
static int |
W
The width of the window
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
Main()
The default constructor used to create the main game handler
|
| Modifier and Type | Method and Description |
|---|---|
Board |
getBoard()
Gets the board object
|
void |
init()
Initializes all instances
|
static void |
main(java.lang.String[] args)
The program's entry point method
|
void |
paint(java.awt.Graphics g)
Draws all the features of the game
|
void |
update()
Updates all the feautes of the game
|
void |
updateGameStates()
Updates the state of the game
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String SERVER_IP_ADDRESS
public static final boolean LOGIN_PANEL_ON
public static final boolean CHAT_PANEL_ON
public static final boolean TITLE_SCREEN_ON
public static final boolean INV_PANEL_ON
public static final boolean INV_IMAGE_PANEL_ON
public static final boolean SHOP_PANEL_ON
public static final boolean SHOP_IMAGE_PANEL_ON
public static final boolean MULTIPLAYER_ON
public static final boolean SOUND_ON
public static final int TIMER_DELAY
public static final double FPS
public static boolean showHitbox
public static javax.swing.JFrame frame
public static Main gamePanel
public static LoginPanel loginPanel
public static ChatPanel chatPanel
public static InventoryPanel invPanel
public static InventoryImagePanel invImagePanel
public static ShopPanel shopPanel
public static ShopImagePanel shopImagePanel
public java.awt.image.BufferedImage newImage
public static java.awt.Graphics g
public static boolean gameStart
public static boolean gameOver
public static int curFrames
public static int curSeconds
public static int curSeconds1
public static int curSeconds2
public static int curMinutes
public static java.util.Random r
public static final int W
public static final int H
public static Board board
public static Camera camera
public static Hud hud
public static GameState gameState
public Menu menu
public TitleScreen titleScreen
public MapScreen mapScreen
public ControlScreen controlScreen
public DeathScreen deathScreen
public EndScreen endScreen
public EndCreditScreen endCreditScreen
public boolean levelCompleted
public HandleSoundFx musicObject
public static SplashScreen splashScreen
public static boolean isLoading
public static int currentStage
public static final int PANEL_NONE
public static final int PANEL_INV
public static final int PANEL_SHOP
public static Item itemPickedUp
public static int itemPickedUpFrom
public static int itemPickedUpRow
public static int itemPickedUpCol
public static int focusedPanel
public Main()
throws java.lang.InterruptedException
java.lang.InterruptedException - When a thread is waiting, sleeping, or
otherwise occupied, and the thread is
interrupted, either before or during the activitypublic Board getBoard()
public void init()
public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - An instance of the Graphics objectpublic void update()
public void updateGameStates()
public static void main(java.lang.String[] args)
throws java.lang.InterruptedException
args - A command line argument representing a collection of variables in the string formatjava.lang.InterruptedException - When a thread is waiting, sleeping, or otherwise occupied,and the
thread is interrupted, either before or during the activity