Advertisement
Filipinex

CApple

Mar 19th, 2024
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import greenfoot.*;  
  2.  
  3. public class CApple extends CTrash
  4. {
  5.     public CApple()
  6.     {
  7.         super(1);
  8.     }
  9.    
  10.     public void ApplyOnFish(CFish fish)
  11.     {
  12.         //ak sa dotkne ryby
  13.         fish.SetParalysisTimer(500); // ryba zamrzne na 500 tickov
  14.         fish.SetMove(false); //pohyb bude false
  15.         fish.TurnOnEating(); //zapne jedenie
  16.         this.getWorld().removeObject(this); // zmizne jedlo
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement