Interface Actor


  • public interface Actor
    Actor represents any figure in a game. It has position, dimensions, name and animation (graphical representation). It belongs to a single scene, where it can have scheduled actions to perform.
    • Method Detail

      • getPosX

        int getPosX()
        Returns:
        X position of the bottom left corner of actor's animation
      • getPosY

        int getPosY()
        Returns:
        Y position of the bottom left corner of actor's animation
      • getWidth

        int getWidth()
        Returns:
        actor's width
      • getHeight

        int getHeight()
        Returns:
        actor's height
      • getName

        @NotNull
        @NotNull java.lang.String getName()
        Returns:
        actor's name
      • getScene

        @Nullable
        @Nullable Scene getScene()
        Returns:
        scene containing the actor
      • getPosition

        @NotNull
        @NotNull Point getPosition()
        Returns:
        actor's position as Point
      • setPosition

        void setPosition​(int posX,
                         int posY)
        Sets actor position by specifying posX and posY coordinates.
      • addedToScene

        void addedToScene​(@NotNull
                          @NotNull Scene scene)
        Called when the actor is added to scene.
      • removedFromScene

        void removedFromScene​(@NotNull
                              @NotNull Scene scene)
        Called when the actor is removed from scene.
      • intersects

        boolean intersects​(@NotNull
                           @NotNull Actor actor)
        Returns:
        true if the actor intersects with the given actor.