This site requires JavaScript, please enable it in your browser!
Greenfoot back
scarereeper
scarereeper wrote ...

2012/10/14

high score

1
2
scarereeper scarereeper

2012/10/19

#
wait game maniac do i change Score=SCORE; to REmove Score = score or what do i do i got the game over part i put it towards the bottom
Game/maniac Game/maniac

2012/10/19

#
Remove Score = SCORE completely
scarereeper scarereeper

2012/10/20

#
oh ok
scarereeper scarereeper

2012/10/28

#
nvm it says i need an indentifier? sorry for all these questions, but im only in middle school
Game/maniac Game/maniac

2012/10/28

#
What is your code so far
scarereeper scarereeper

2012/10/28

#
for gameover import greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot) import java.awt.Color; import java.awt.Font; import java.util.Calendar; /** * The ScoreBoard is used to display results on the screen. It can display some * text and several numbers. * * @author M Kolling * @version 1.0 */ public class GameOver extends Actor { public static final float FONT_SIZE = 48.0f; public static final int WIDTH = 400; public static final int HEIGHT = 300; int SCORE=0; /** * Create a score board with dummy result for testing. */ public GameOver() { this(100); } /** * Create a score board for the final result. */ public GameOver(int score) { makeImage("Game Over", "Score: ", "Press enter", score); SCORE=score; } /** * Make the score board image. */ private void makeImage(String title, String prefix, String prefix2, int score) { GreenfootImage image = new GreenfootImage(WIDTH, HEIGHT); image.setColor(new Color(255,255,255, 128)); image.fillRect(0, 0, WIDTH, HEIGHT); image.setColor(new Color(0, 0, 0, 128)); image.fillRect(5, 5, WIDTH-10, HEIGHT-10); Font font = image.getFont(); font = font.deriveFont(FONT_SIZE); image.setFont(font); image.setColor(Color.WHITE); image.drawString(title, 60, 100); image.drawString(prefix + score, 60, 200); image.drawString(prefix2, 60, 250); setImage(image); } public void act() { if(Greenfoot.isKeyDown("enter")){ CrabWorld crabworld = (CrabWorld) getWorld(); crabworld.scoreboard(SCORE); getWorld().removeObject(this); } if(Greenfoot.isKeyDown("e")){ CrabWorld crabworld = (CrabWorld) getWorld(); crabworld.scoreboard(SCORE); getWorld().removeObject(this); } } CrabWorld world = (CrabWorld) getWorld(); CrabWorld.ScoreBoard(points);
scarereeper scarereeper

2012/10/28

#
at the very end ScoreBoard needs a identifier
danpost danpost

2012/10/29

#
Remove the last two lines of code that read
CrabWorld world = (CrabWorld) getWorld();
CrabWorld.ScoreBoard(points);
scarereeper scarereeper

2012/10/29

#
ok
scarereeper scarereeper

2012/11/25

#
public void scoreboard(int SCORE); ScoreBoard sb = new ScoreBoard(600, 600); addObject(sb,getWidth()/2,getHeight() / 2); if (Userinfo...{ // if block code// } } here it says i need a return type but my return type is right here in my scoreboard. HELP
danpost danpost

2012/11/25

#
You need an open bracket at the end of the method declaration, not a semi-colon.
You need to login to post a reply.
1
2