Package Worms

Class Grenade


  • class Grenade
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double delay  
      (package private) double dx  
      (package private) double dy  
      (package private) int rotation  
      (package private) double time  
      private double x  
      private double y  
    • Constructor Summary

      Constructors 
      Constructor Description
      Grenade​(double posX, double posY, double dx, double dy)
      Konstruktor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getRotation()
      vrati rotaciu
      double getX()
      vrati X
      double getY()
      vrati Y
      void plusRotation​(int r)
      zvysi rotaciu
      boolean update​(int h, int w)
      PosĂşva naboj
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        private double x
      • y

        private double y
      • dx

        double dx
      • dy

        double dy
      • time

        double time
      • delay

        double delay
      • rotation

        int rotation
    • Constructor Detail

      • Grenade

        public Grenade​(double posX,
                       double posY,
                       double dx,
                       double dy)
        Konstruktor
        Parameters:
        posX - x-ova pozicia naboja
        posY - y-ova pozicia naboja
        dx - x-ova rychlost
        dy - y-ova rychlost
    • Method Detail

      • update

        public boolean update​(int h,
                              int w)
        PosĂşva naboj
        Parameters:
        h - vyska sceny
        w - sirka sceny
        Returns:
        false= naboj mimo sceny, true= naboj je vnutri sceny
      • getX

        public double getX()
        vrati X
        Returns:
        X
      • getY

        public double getY()
        vrati Y
        Returns:
        y
      • getRotation

        public int getRotation()
        vrati rotaciu
        Returns:
        rotacia
      • plusRotation

        public void plusRotation​(int r)
        zvysi rotaciu
        Parameters:
        r - kolko rotacie sa prida