Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import greenfoot.*;
- public abstract class CTrash extends Actor
- {
- //deklaracia
- protected int Weight;
- public CTrash(int weight) //odpad ma nejaku hmotnost na zaklade
- {
- this.Weight = weight; //ktorej sa urcuje rychlost padania
- this.setRotation(90); //otocenie aby to bolo krajsie
- }
- public void act()
- {
- Initialize(); // "inicializacia"
- }
- public void Initialize()
- {
- this.move(this.Weight); //bude sa hybat na zaklade svojej hmotnosti
- if (this.isAtEdge()) //ak sa dotkne steny
- {
- this.getWorld().removeObject(this);//zmizne
- }
- }
- public abstract void ApplyOnFish(CFish fish);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement