-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlocks.java
More file actions
25 lines (24 loc) · 754 Bytes
/
Copy pathBlocks.java
File metadata and controls
25 lines (24 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Blocks here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Blocks extends Actor
{
/**
* Act - do whatever the Blocks wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
}
public void fall(){
Ground ground = (Ground)getOneIntersectingObject(Ground.class);
Blocks blocks = (Blocks)getOneIntersectingObject(Blocks.class);
if(ground != null){}else if((blocks != null)){}else{
setLocation(getX(),getY()+4);
}
}
}