Package schule.ngb.zm
Class Spielemaschine
java.lang.Object
schule.ngb.zm.Constants
schule.ngb.zm.Zeichenmaschine
schule.ngb.zm.Spielemaschine
-
Field Summary
Fields inherited from class schule.ngb.zm.Zeichenmaschine
background, canvas, cursorVisible, drawing, frame, globalSyncLock, IN_BLUEJ, shapesFields inherited from class schule.ngb.zm.Constants
APP_NAME, APP_VERSION, APP_VERSION_MAJ, APP_VERSION_MIN, APP_VERSION_REV, ARROW, BEVEL, BLACK, BLUE, BOLD, BROWN, canvasHeight, canvasWidth, CENTER, CLOSED, cmouseX, cmouseY, CROSS, CYAN, DARKGRAY, DASHED, DEFAULT_ANIM_RUNTIME, DEFAULT_BACKGROUND, DEFAULT_BUFFER, DEFAULT_EASING, DEFAULT_FILLCOLOR, DEFAULT_FONTSIZE, DEFAULT_FPS, DEFAULT_HEIGHT, DEFAULT_STROKECOLOR, DEFAULT_STROKEWEIGHT, DEFAULT_WIDTH, delta, DOTTED, DOWN, DOWNLEFT, DOWNRIGHT, EAST, FILLED, framesPerSecond, GRAY, GREEN, HALF_PI, HAND, ITALIC, key, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_A, KEY_ALT, KEY_B, KEY_BACK_SPACE, KEY_C, KEY_CANCEL, KEY_CAPS_LOCK, KEY_CLEAR, KEY_COMMA, KEY_CONTROL, KEY_D, KEY_DOWN, KEY_E, KEY_END, KEY_ENTER, KEY_EQUALS, KEY_ESCAPE, KEY_F, KEY_G, KEY_H, KEY_HOME, KEY_I, KEY_J, KEY_K, KEY_L, KEY_LEFT, KEY_M, KEY_MINUS, KEY_N, KEY_O, KEY_P, KEY_PAGE_DOWN, KEY_PAGE_UP, KEY_PAUSE, KEY_PERIOD, KEY_Q, KEY_R, KEY_RIGHT, KEY_S, KEY_SEMICOLON, KEY_SHIFT, KEY_SLASH, KEY_SPACE, KEY_T, KEY_TAB, KEY_U, KEY_UP, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, keyCode, keyEvent, keyPressed, LEFT, LIGHTGRAY, LINES, LINUX, MACOS, MAGENTA, MIDDLE, MITER, MOUSE1, MOUSE2, MOUSE3, mouseButton, mouseEvent, mousePressed, mouseX, mouseY, MOVE, NOMOUSE, NORTH, NORTHEAST, NORTHWEST, OPEN, ORANGE, PI, PIE, PINK, PLAIN, pmouseX, pmouseY, PURPLE, QUARTER_PI, RED, RIGHT, ROUND, runtime, screenHeight, screenWidth, SOLID, SOUTH, SOUTHEAST, SOUTHWEST, TEXT, tick, TWO_PI, UP, UPLEFT, UPRIGHT, WAIT, WEST, WHITE, WINDOWS, YELLOW -
Constructor Summary
ConstructorsConstructorDescriptionSpielemaschine(int width, int height, String title) Spielemaschine(String title) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidaddDrawable(Drawable pDrawable) final voidaddUpdatable(Updatable pUpdatable) final voiddraw()draw()wird einmal pro Frame aufgerufen.final voidfinal voidremoveDrawable(Drawable pDrawable) final voidremoveUpdatable(Updatable pUpdatable) final voidupdate(double delta) update()wird einmal pro Frame vorZeichenmaschine.draw()aufgerufen, um notwendige Aktualisierungen vorzunehmen.protected voidupdateGame(double delta) Methods inherited from class schule.ngb.zm.Zeichenmaschine
addLayer, centerFrame, delay, exit, exitNow, fullscreenChanged, getBackgroundLayer, getCanvas, getDrawingLayer, getFramesPerSecond, getHeight, getImage, getLayer, getLayer, getLayerCount, getShapesLayer, getState, getWidth, hide, hideCursor, isFullscreen, isPaused, isTerminated, isTerminating, keyPressed, keyPressed, keyReleased, keyReleased, keyTyped, keyTyped, mouseClicked, mouseClicked, mouseDragged, mouseDragged, mouseMoved, mouseMoved, mousePressed, mousePressed, mouseReleased, mouseReleased, mouseWheelMoved, mouseWheelMoved, pause, quit, quit, redraw, render, resume, saveImage, saveImage, scheduleTask, scheduleTask, setCursor, setCursor, setCursor, setFramesPerSecond, setFullscreen, setSize, settings, setTitle, setup, show, showCursor, shutdown, snapshot, stopMethods inherited from class schule.ngb.zm.Constants
abs, arccos, arcsin, arctan, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asBool, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asDouble, asInt, asInt, asInt, asInt, asInt, asInt, asInt, asInt, asInt, avg, binary, ceil, choice, choice, choice, choice, color, color, color, color, colorHsb, colorHsl, cos, degrees, distance, floor, fromBinary, fromHex, getRandom, hex, interpolate, limit, limit, loadImage, map, max, max, min, min, morph, noise, noise, noise, noise, pow, radians, random, random, random, random, random, randomBool, randomBool, randomBool, randomColor, randomGaussian, randomNiceColor, round, setSeed, shuffle, shuffle, shuffle, shuffle, sign, sin, sqrt, sum, tan
-
Constructor Details
-
Spielemaschine
-
Spielemaschine
-
-
Method Details
-
add
-
addDrawable
-
addUpdatable
-
remove
-
removeDrawable
-
removeUpdatable
-
updateGame
protected void updateGame(double delta) -
update
public final void update(double delta) Description copied from class:Zeichenmaschineupdate()wird einmal pro Frame vorZeichenmaschine.draw()aufgerufen, um notwendige Aktualisierungen vorzunehmen. Im Gegensatz zuZeichenmaschine.draw()bekommtupdate()zusätzlichConstants.deltaübergeben, um die Aktualisierungen abhängig von der echten Verzögerung zwischen zwei Frames zu berechnen.deltawird in Sekunden angegeben. Um eine Form zum Beispiel um50Pixel pro Sekunde inx-Richtung zu bewegen, kann so vorgegangen werden:shape.move(50*delta, 0.0);- Overrides:
updatein classZeichenmaschine
-
draw
public final void draw()Description copied from class:Zeichenmaschinedraw()wird einmal pro Frame aufgerufen. Bei einerFrameratevon 60 also in etwa 60-Mal pro Sekunde. In derdraw-Methode wird der Inhalt der Ebenen manipuliert und deren Inhalte gezeichnet. Am Ende des Frames werden alle Ebenen auf dieZeichenleinwandübertragen.draw()stellt die wichtigste Methode für eine Zeichenmaschine dar, da hier die Zeichnung des Programms erstellt wird.- Overrides:
drawin classZeichenmaschine
-