Package playground
Class LevelMovingObjects
java.lang.Object
playground.Playground
playground.SpaceInvadersLevel
playground.LevelMovingObjects
This level adds two distracting objects to the canvas that cannot collide but bounce around all the time.
-
Field Summary
Fields inherited from class playground.SpaceInvadersLevel
alienImage, alienshowTime, BONUS_DURATION, CANVASX, CANVASY, doneLevel, DYING_INTERVAL, EGORAD, EGOSPEED, enemyAnim, ENEMYSCALE, ENEMYSHOTSPEED, ENEMYSPEEDX, ENEMYSPEEDY, EXPL_COLOR, EXPL_DURATION, heartAnim, heartImage, heartshowTime, laser, LEVEL_INIT_TIME, LEVEL2STARS, lost, nextShot, NR_COLLECT, NR_ENEMIES, NRSHARDS, SHARDSPEED, SHOTSPEED, smash, STARSPEED, STARTPERIOD, STARTTEXTSPEED, starttime
Fields inherited from class playground.Playground
addables, canvasX, canvasY, flags, FLAGS_ALL, FLAGS_GLOBAL, FLAGS_LEVEL, gameObjects, gameTime, keyEvents, level, mouseEvents, pausedFlag, removables, timeStep
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
"Moving Objects Level!"void
prepareLevel
(String id) initially sets up the level.Methods inherited from class playground.SpaceInvadersLevel
actionIfEgoCollidesWithCollect, actionIfEgoCollidesWithEnemy, actionIfEgoObjectIsHit, actionIfEnemyIsHit, applyGameLogic, calcEnemyShotProb, calcEnemySpeedX, calcEnemySpeedY, calcNrCollect, calcNrEnemies, createCollectables, createEgoObject, createEnemies, createEnemyController, createEnemyShot, createEnemyShotObject, createExplosion, createSingleCollect, createSingleEnemy, createStars, gameOver, levelFinished, preferredSizeX, preferredSizeY, redrawLevel, setupInitialState
Methods inherited from class playground.Playground
addObject, addObjectNow, collectObjects, deleteObject, deleteObjectNow, getGameTime, getGlobalFlag, getKeyEvents, getLevelFlag, getMouseEvents, getObject, getOrCreateGlobalFlag, getOrCreateLevelFlag, getSizeX, getSizeY, getTimestep, isPaused, processKeyEvents, processMouseEvents, redraw, reset, resetFlags, setGameTime, setGlobalFlag, setLevelFlag, setPaused, setTimestep, togglePause, updateObjects
-
Constructor Details
-
LevelMovingObjects
public LevelMovingObjects()
-
-
Method Details
-
getStartupMessage
"Moving Objects Level!" is the message.- Overrides:
getStartupMessage
in classSpaceInvadersLevel
- Returns:
- String "Moving Objects Level!"
-
prepareLevel
Description copied from class:SpaceInvadersLevel
initially sets up the level. Not called by user interaction, but called every time a layer is restarted from scratch. So make sure that this is possible. Here, resources are loaded only once even if method is called several times.- Overrides:
prepareLevel
in classSpaceInvadersLevel
- Parameters:
id
- String identifies level.
-