Package Worms

Class Bullet


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

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

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getX()
      vrati X
      double getY()
      vrati Y
      boolean update​(int h, int w)
      Posuva 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

        private double dx
      • dy

        private double dy
      • time

        double time
      • delay

        double delay
    • Constructor Detail

      • Bullet

        public Bullet​(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)
        Posuva 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