Documentation of 'jvx.cellular.PwSnake' Java class
PwSnake ("JavaView Reference Manual")
"JavaView? v5.03.003"
jvx.cellular

Class PwSnake

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.util.EventListener, PsUpdateIf, PjWorkshopIf


    public class PwSnake
    extends PjWorkshop
    implements java.awt.event.KeyListener, java.lang.Runnable
    Snake game on arbitrary polyhedral surfaces.
    See Also:
    Serialized Form
    Author:
    Ulrich Reitebuch
    Version:
    02.02.06, 1.10 revised (ur) Added a key buffer.
    29.01.06, 1.00 created (ur)
    • Constructor Detail

      • PwSnake

        public PwSnake()
        Constructor
    • Method Detail

      • init

        public void init()
        Resets all properties to default values.
        Overrides:
        init in class PjWorkshop
      • reset

        public void reset()
        Reset workshop and geometry to original state. Initialize necessary data to run the snake game.
        Overrides:
        reset in class PjWorkshop
      • close

        public void close()
        Remove key listener from display, reset elementSet to state before starting the game, and destroy dialog window.
        Overrides:
        close in class PjWorkshop
      • keyPressed

        public void keyPressed(java.awt.event.KeyEvent e)
        Store, if "Right" or "Left" key is pressed.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased(java.awt.event.KeyEvent e)
        Store, if "Right" or "Left" key is pressed.
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyTyped

        public void keyTyped(java.awt.event.KeyEvent e)
        Just to fulfill KeyListener interface.
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • start

        public void start()
        Start snake game in separate thread.
      • stop

        public void stop()
        Stop snake game in separate thread.
      • pause

        public void pause()
        Pauses the game.
      • resume

        public void resume()
        Resumes a paused game.
      • run

        public void run()
        Run the snake until it dies.
        Specified by:
        run in interface java.lang.Runnable
"JavaView? v5.03.003"

"

The software JavaView? is copyright protected. All Rights Reserved.
"

You see the box below because you did not login.