moagg.game
Class MultiPlayerServerGameObject

java.lang.Object
  extended by com.golden.gamedev.GameObject
      extended by moagg.game.MultiPlayerServerGameObject

public class MultiPlayerServerGameObject
extends com.golden.gamedev.GameObject


Field Summary
 
Fields inherited from class com.golden.gamedev.GameObject
bsGraphics, bsInput, bsIO, bsLoader, bsMusic, bsSound, bsTimer, fontManager, parent
 
Constructor Summary
MultiPlayerServerGameObject(com.golden.gamedev.GameEngine parent, java.lang.String mission, java.lang.String missionLevel)
           
 
Method Summary
 void addProjectile(ShootableObject shootable)
           
protected  void broadcastCreateShipPacket(MultiPlayerClientData data)
           
protected  void broadcastDestroyProjectilePacket(DestroyableObject destroyable)
           
protected  void broadcastDisconnect(MultiPlayerClientData data)
           
protected  void broadcastUpdateFragsPacket()
           
protected  void broadcastUpdateShipPacket(MultiPlayerClientData data)
           
protected  void checkDestroyedObjects()
           
protected  void checkFrags()
           
protected  Ship findShipByNetworkId(short networkId)
           
 void finish()
           
 MultiPlayerClientData getClientData(int id)
           
 GameControl getGameControl()
           
 Level getLevel()
           
 com.golden.gamedev.object.SpriteGroup getObjectsSpriteGroup()
           
 com.golden.gamedev.object.SpriteGroup getPlayersSpriteGroup()
           
 com.golden.gamedev.object.SpriteGroup getProjectilesSpriteGroup()
           
protected  void initBackground()
           
protected  void initCollisionGroups()
           
protected  Ship initPlayer(int shipType)
           
protected  void initPlayer2(Ship player)
          This method initializes the player's ship for the initial (or a further) life.
 void initResources()
           
 void initResources2()
           
protected  void processPacket(com.golden.gamedev.engine.network.NetworkPacket packet, MultiPlayerClientData data)
           
 void render(java.awt.Graphics2D g)
           
 void renderPreview(java.awt.Graphics2D g)
           
protected  void resetPlayer(Ship player)
          This method resets any upgrades the player's ship might have.
protected  void sendCreateShipPacket(MultiPlayerClientData data, com.golden.gamedev.engine.BaseClient client)
           
 void update(long elapsedTime)
           
 
Methods inherited from class com.golden.gamedev.GameObject
checkPosMouse, checkPosMouse, click, drawFPS, getCurrentFPS, getFPS, getHeight, getImage, getImage, getImages, getImages, getImages, getImages, getImages, getImages, getMouseX, getMouseY, getRandom, getWidth, hideCursor, keyDown, keyPressed, playMusic, playSound, rightClick, setFPS, setMaskColor, showCursor, start, takeScreenShot, takeScreenShot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPlayerServerGameObject

public MultiPlayerServerGameObject(com.golden.gamedev.GameEngine parent,
                                   java.lang.String mission,
                                   java.lang.String missionLevel)
Method Detail

getLevel

public Level getLevel()

getClientData

public MultiPlayerClientData getClientData(int id)

initPlayer

protected Ship initPlayer(int shipType)

resetPlayer

protected void resetPlayer(Ship player)
This method resets any upgrades the player's ship might have.


initPlayer2

protected void initPlayer2(Ship player)
This method initializes the player's ship for the initial (or a further) life.


getGameControl

public GameControl getGameControl()

getProjectilesSpriteGroup

public com.golden.gamedev.object.SpriteGroup getProjectilesSpriteGroup()

getObjectsSpriteGroup

public com.golden.gamedev.object.SpriteGroup getObjectsSpriteGroup()

getPlayersSpriteGroup

public com.golden.gamedev.object.SpriteGroup getPlayersSpriteGroup()

addProjectile

public void addProjectile(ShootableObject shootable)

initResources

public void initResources()
Specified by:
initResources in class com.golden.gamedev.GameObject

initResources2

public void initResources2()

initBackground

protected void initBackground()

initCollisionGroups

protected void initCollisionGroups()

render

public void render(java.awt.Graphics2D g)
Specified by:
render in class com.golden.gamedev.GameObject

renderPreview

public void renderPreview(java.awt.Graphics2D g)

update

public void update(long elapsedTime)
Specified by:
update in class com.golden.gamedev.GameObject

checkFrags

protected void checkFrags()

checkDestroyedObjects

protected void checkDestroyedObjects()

findShipByNetworkId

protected Ship findShipByNetworkId(short networkId)

processPacket

protected void processPacket(com.golden.gamedev.engine.network.NetworkPacket packet,
                             MultiPlayerClientData data)
                      throws java.io.IOException
Throws:
java.io.IOException

broadcastCreateShipPacket

protected void broadcastCreateShipPacket(MultiPlayerClientData data)

sendCreateShipPacket

protected void sendCreateShipPacket(MultiPlayerClientData data,
                                    com.golden.gamedev.engine.BaseClient client)
                             throws java.io.IOException
Throws:
java.io.IOException

broadcastUpdateShipPacket

protected void broadcastUpdateShipPacket(MultiPlayerClientData data)

broadcastDestroyProjectilePacket

protected void broadcastDestroyProjectilePacket(DestroyableObject destroyable)

broadcastUpdateFragsPacket

protected void broadcastUpdateFragsPacket()

broadcastDisconnect

protected void broadcastDisconnect(MultiPlayerClientData data)
                            throws java.io.IOException
Throws:
java.io.IOException

finish

public void finish()
Overrides:
finish in class com.golden.gamedev.GameObject


Copyright © 2008. All Rights Reserved.