Skip to content

Commit f680683

Browse files
committed
added files
1 parent 81fc53b commit f680683

File tree

743 files changed

+10957
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

743 files changed

+10957
-0
lines changed

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#Git
2+
.cache
3+
4+
#Gradle
5+
.gradle/
6+
build/
7+
gradle-app.setting
8+
9+
#Other
10+
*.log
11+
12+
#Eclipse
13+
.project
14+
.classpath
15+
.settings/
16+
bin/
17+
18+
#IntelliJ
19+
*.iml
20+
*.ipr
21+
*.iws
22+
.idea/
23+
out/
24+
projectFilesBackup*/
25+
26+
#Scala
27+
.scala_dependencies
28+
.worksheet
29+
30+
#SBT
31+
.cache/
32+
.history/
33+
.lib/
34+
dist/*
35+
target/
36+
lib_managed/
37+
src_managed/
38+
project/boot/
39+
project/plugins/project/
40+
41+
#Java
42+
*.class

Apple.ctxt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#BlueJ class context
2+
comment0.params=obj
3+
comment0.target=boolean\ solidAgainst(GameObj)
4+
comment1.params=obj
5+
comment1.target=boolean\ solidAgainstPost(GameObj)
6+
comment2.params=obj
7+
comment2.target=boolean\ pushable(GameObj)
8+
comment3.params=
9+
comment3.target=void\ created()
10+
comment4.params=
11+
comment4.target=void\ onRemove()
12+
comment5.params=
13+
comment5.target=int\ getId()
14+
numComments=6

Apple.java

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Apple here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class Apple extends GameObj
10+
{
11+
public boolean solidAgainst(GameObj obj) {
12+
return !(obj instanceof Pushy || obj instanceof LaserRay);
13+
}
14+
15+
public boolean solidAgainstPost(GameObj obj) {
16+
if (obj instanceof Pushy) {
17+
remove();
18+
Sound.drop.play();
19+
}
20+
return false;
21+
}
22+
23+
public boolean pushable(GameObj obj) {
24+
return (obj instanceof PowerPistonHead);
25+
}
26+
27+
public void created() {
28+
getWorld().openGoal();
29+
}
30+
31+
public void onRemove() {
32+
getWorld().closeGoal();
33+
}
34+
35+
public int getId() {
36+
return 21;
37+
}
38+
}

Ball.ctxt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ update()
4+
comment1.params=color\ bool
5+
comment1.target=java.lang.String\ getColoredIcon(int,\ boolean)
6+
comment2.params=
7+
comment2.target=int\ getColor()
8+
comment3.params=color
9+
comment3.target=void\ setColor(int)
10+
comment4.params=obj
11+
comment4.target=boolean\ pushable(GameObj)
12+
comment5.params=
13+
comment5.target=void\ created()
14+
comment6.params=
15+
comment6.target=void\ onRemove()
16+
numComments=7

Ball.java

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Ball here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class Ball extends GameObj implements IColored
10+
{
11+
public void update()
12+
{
13+
setImage(getColoredIcon(getColor(), false));
14+
}
15+
16+
public String getColoredIcon(int color, boolean bool) {
17+
if (color==1) return "1.png";
18+
if (color==2) return "2.png";
19+
if (color==3) return "113.png";
20+
if (color==4) return "3.png";
21+
return "100.png";
22+
}
23+
24+
public int getColor() {
25+
return extraData.getInt("color");
26+
}
27+
28+
public void setColor(int color) {
29+
extraData.setInt("color", color);
30+
setImage(getColoredIcon(color, false));
31+
}
32+
33+
public boolean pushable(GameObj obj) {
34+
return (obj instanceof Pushy || obj instanceof PowerPistonHead);
35+
}
36+
37+
public void created() {
38+
getWorld().openGoal();
39+
}
40+
41+
public void onRemove() {
42+
getWorld().closeGoal();
43+
}
44+
}

BallBlue.ctxt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ created()
4+
comment1.params=
5+
comment1.target=int\ getId()
6+
numComments=2

BallBlue.java

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Blue here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class BallBlue extends Ball
10+
{
11+
public void created() {
12+
super.created();
13+
setColor(2);
14+
}
15+
16+
public int getId() {
17+
return 2;
18+
}
19+
}

BallGreen.ctxt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ created()
4+
comment1.params=
5+
comment1.target=int\ getId()
6+
numComments=2

BallGreen.java

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Green here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class BallGreen extends Ball
10+
{
11+
public void created() {
12+
super.created();
13+
setColor(4);
14+
}
15+
16+
public int getId() {
17+
return 3;
18+
}
19+
}

BallRed.ctxt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ created()
4+
comment1.params=
5+
comment1.target=int\ getId()
6+
numComments=2

BallRed.java

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Red here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class BallRed extends Ball
10+
{
11+
public void created() {
12+
super.created();
13+
setColor(1);
14+
}
15+
16+
public int getId() {
17+
return 1;
18+
}
19+
}

BallYellow.ctxt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ created()
4+
comment1.params=
5+
comment1.target=int\ getId()
6+
numComments=2

BallYellow.java

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class BYellow here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class BallYellow extends Ball
10+
{
11+
public void created() {
12+
super.created();
13+
setColor(3);
14+
}
15+
16+
public int getId() {
17+
return 101;
18+
}
19+
}

Box.ctxt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#BlueJ class context
2+
comment0.params=obj
3+
comment0.target=boolean\ pushable(GameObj)
4+
comment1.params=
5+
comment1.target=int\ getId()
6+
numComments=2

Box.java

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class Box here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class Box extends GameObj
10+
{
11+
public boolean pushable(GameObj obj) {
12+
return (obj instanceof Pushy || obj instanceof PowerPistonHead);
13+
}
14+
15+
public int getId() {
16+
return 9;
17+
}
18+
}

BoxGoal.ctxt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#BlueJ class context
2+
comment0.params=
3+
comment0.target=void\ created()
4+
comment1.params=obj
5+
comment1.target=boolean\ solidAgainst(GameObj)
6+
comment2.params=obj
7+
comment2.target=boolean\ solidAgainstPost(GameObj)
8+
comment3.params=obj
9+
comment3.target=void\ onLeave(GameObj)
10+
comment4.params=
11+
comment4.target=int\ getRenderOrder()
12+
comment5.params=
13+
comment5.target=int\ getId()
14+
numComments=6

BoxGoal.java

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
2+
3+
/**
4+
* Write a description of class BoxGoal here.
5+
*
6+
* @author (your name)
7+
* @version (a version number or a date)
8+
*/
9+
public class BoxGoal extends GameObj
10+
{
11+
public void created() {
12+
getWorld().openGoal();
13+
}
14+
15+
public boolean solidAgainst(GameObj obj) {
16+
return false;
17+
}
18+
19+
public boolean solidAgainstPost(GameObj obj) {
20+
if (obj instanceof Box) {
21+
getWorld().closeGoal();
22+
Sound.drop.play();
23+
}
24+
return false;
25+
}
26+
27+
public void onLeave(GameObj obj) {
28+
if (obj instanceof Box) {
29+
getWorld().openGoal();
30+
}
31+
}
32+
33+
public int getRenderOrder() {
34+
return GameObj.R_Bck;
35+
}
36+
37+
public int getId() {
38+
return 18;
39+
}
40+
}

Button.ctxt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#BlueJ class context
2+
comment0.params=obj
3+
comment0.target=boolean\ solidAgainst(GameObj)
4+
comment1.params=obj
5+
comment1.target=boolean\ solidAgainstPost(GameObj)
6+
comment2.params=obj
7+
comment2.target=void\ onLeave(GameObj)
8+
comment3.params=
9+
comment3.target=void\ onRemove()
10+
comment4.params=
11+
comment4.target=int\ getRenderOrder()
12+
comment5.params=
13+
comment5.target=int\ getId()
14+
numComments=6

0 commit comments

Comments
 (0)