Commit b7655826 authored by Daffa Mudia Athifah's avatar Daffa Mudia Athifah
Browse files

upload

parent c52da5bd
No related merge requests found
Showing with 192 additions and 0 deletions
+192 -0
File added
#BlueJ class context
comment0.target=BackWorld
comment0.text=\r\n\ Write\ a\ description\ of\ class\ BackWorld\ here.\r\n\ \r\n\ @author\ (Daffa\ Mudia\ Athifah)\ \r\n\ NIM\ (V3420022)\r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=BackWorld()
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ BackWorld.\r\n\ \r\n
comment2.params=
comment2.target=void\ prepare()
comment2.text=\r\n\ Prepare\ the\ world\ for\ the\ start\ of\ the\ program.\r\n\ That\ is\:\ create\ the\ initial\ objects\ and\ add\ them\ to\ the\ world.\r\n
comment3.params=
comment3.target=void\ addKudaLaut()
comment4.params=
comment4.target=void\ updateScore()
numComments=5
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class BackWorld here.
*
* @author (Daffa Mudia Athifah)
* NIM (V3420022)
* @version (a version number or a date)
*/
public class BackWorld extends World
{
/**
* Constructor for objects of class BackWorld.
*
*/
public BackWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(700, 400, 1);
prepare();
addKudaLaut();
updateScore();
}
/**
* Prepare the world for the start of the program.
* That is: create the initial objects and add them to the world.
*/
private void prepare()
{
littleFish littleFish = new littleFish();
addObject(littleFish,getWidth()/2,getHeight()/2);
}
public void addKudaLaut()
{
if(Greenfoot.getRandomNumber(100)>1)
{
//for(int i = 0;i<30; i++)
for(int j = 0; j < 5; j++)
{
addObject(new KudaLaut(),5, Greenfoot.getRandomNumber(380));
addObject(new KudaLaut(),680, Greenfoot.getRandomNumber(380));
}
}
}
int score = 0;
public void updateScore()
{
score++;
showText("Score= "+ score, 650, 490);
if(score > 50)
{
Greenfoot.stop();
showText("Selamat Anda Menang", 350,250);
}
}
}
File added
#BlueJ class context
comment0.target=BigFish
comment0.text=\r\n\ Write\ a\ description\ of\ class\ BigFish\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=void\ act()
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ BigFish\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
numComments=2
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class BigFish here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class BigFish extends Mover
{
/**
* Act - do whatever the BigFish wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}
File added
#BlueJ class context
comment0.target=KudaLaut
comment0.text=\r\n\ Write\ a\ description\ of\ class\ KudaLaut\ here.\r\n\ \r\n\ @author\ (Daffa\ Mudia\ Athifah)\r\n\ NIM\ (v3420022)\r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=void\ act()
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ KudaLaut\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
numComments=2
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class KudaLaut here.
*
* @author (Daffa Mudia Athifah)
* NIM (v3420022)
* @version (a version number or a date)
*/
public class KudaLaut extends Actor
{
/**
* Act - do whatever the KudaLaut wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(Greenfoot.getRandomNumber(2));
}
}
File added
#BlueJ class context
comment0.target=Mover
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Mover\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=void\ act()
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ Mover\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
numComments=2
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Mover here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Mover extends Actor
{
/**
* Act - do whatever the Mover wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
}
}
File added
#BlueJ class context
comment0.target=MyWorld
comment0.text=\r\n\ Write\ a\ description\ of\ class\ MyWorld\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
comment1.params=
comment1.target=MyWorld()
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ MyWorld.\r\n\ \r\n
numComments=2
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MyWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyWorld extends World
{
/**
* Constructor for objects of class MyWorld.
*
*/
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 400, 1);
}
}
------------------------------------------------------------------------
This is the project README file. Here, you should describe your project.
Tell the reader (someone who does not know anything about this project)
all he/she needs to know. The comments should usually include at least:
------------------------------------------------------------------------
PROJECT TITLE:
PURPOSE OF PROJECT:
VERSION or DATE:
HOW TO START THIS PROJECT:
AUTHORS:
USER INSTRUCTIONS:
images/bluerock.jpg

3.57 KB

images/fish2.png

1.6 KB

images/fish2_kiri.png

1.8 KB

images/fish3.png

1.7 KB

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment