Results 1 to 4 of 4
  1. #1
    YLTO is offline Member
    Join Date
    Jun 2011
    Location
    Jakarta
    Posts
    5
    Rep Power
    0

    Default [Help]Make a Breakout Game - CS106A

    Hello, programmers!

    I take the free stanford CS106A course, however I take 1 month break and as a result I have a little remembrance on what I learn.

    So I'm on breakout assignment right now, previously I just want to skip over due to its complexity but somewhat I'm just feel guilty to do it and I also do not want to copy other people's code.

    I need your guide on how to decompose this problem. From the handout, I was told to build the brick first but sadly I don't know how to start. Indeed I'd build several programs from CS106A but it's still quite hard in this assignment on how to figure out the decomposition.

    Could you give me a clue/hints?

    Your help would greatly appreciated. Thanks :)

    Java Code:
    /*
     * File: Breakout.java
     * -------------------
     * Name: 
     * Section Leader:
     * 
     * This file will eventually implement the game of Breakout.
     */
    
    import acm.graphics.*;
    import acm.program.*;
    import acm.util.*;
    
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    
    public class Breakout extends GraphicsProgram {
    
    /** Width and height of application window in pixels */
    	public static final int APPLICATION_WIDTH = 400;
    	public static final int APPLICATION_HEIGHT = 600;
    
    /** Dimensions of game board (usually the same) */
    	private static final int WIDTH = APPLICATION_WIDTH;
    	private static final int HEIGHT = APPLICATION_HEIGHT;
    
    /** Dimensions of the paddle */
    	private static final int PADDLE_WIDTH = 60;
    	private static final int PADDLE_HEIGHT = 10;
    
    /** Offset of the paddle up from the bottom */
    	private static final int PADDLE_Y_OFFSET = 30;
    
    /** Number of bricks per row */
    	private static final int NBRICKS_PER_ROW = 10;
    
    /** Number of rows of bricks */
    	private static final int NBRICK_ROWS = 10;
    
    /** Separation between bricks */
    	private static final int BRICK_SEP = 4;
    
    /** Width of a brick */
    	private static final int BRICK_WIDTH =
    	  (WIDTH - (NBRICKS_PER_ROW - 1) * BRICK_SEP) / NBRICKS_PER_ROW;
    
    /** Height of a brick */
    	private static final int BRICK_HEIGHT = 8;
    
    /** Radius of the ball in pixels */
    	private static final int BALL_RADIUS = 10;
    
    /** Offset of the top brick row from the top */
    	private static final int BRICK_Y_OFFSET = 70;
    
    /** Number of turns */
    	private static final int NTURNS = 3;
    
    /* Method: run() */
    /** Runs the Breakout program. */
    	public void run() {
    		GLabel welcome = new GLabel("Welcome to Breakout, Dude");
    		
    	}
    
    	public void gameSetup() {
    		createBricks();
    	}
    	
    	private void createBricks() {
    		
    	}
    }
    Last edited by YLTO; 10-25-2011 at 04:06 PM.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,993
    Rep Power
    9

    Default Re: [Help]Make a Breakout Game - CS106A

    Sounds like you need to go back to the basics and play catch up. You can't just miss a month of your curriculum and expect to hit the ground running.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    YLTO is offline Member
    Join Date
    Jun 2011
    Location
    Jakarta
    Posts
    5
    Rep Power
    0

    Default Re: [Help]Make a Breakout Game - CS106A

    Quote Originally Posted by KevinWorkman View Post
    Sounds like you need to go back to the basics and play catch up. You can't just miss a month of your curriculum and expect to hit the ground running.
    My bad :( . Did you mean I should repeat it from the beginning?

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,993
    Rep Power
    9

    Default Re: [Help]Make a Breakout Game - CS106A

    Quote Originally Posted by YLTO View Post
    My bad :( . Did you mean I should repeat it from the beginning?
    Start from wherever you feel comfortable. If that's the beginning, then yes.

    Think about it- if somebody is trying to learn calculus, they can't just skip algebra. If you're trying to learn how to program, you can't skip sections, or you'll have no idea what's going on. Even if we got this code to work for you, you wouldn't actually be learning anything.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Breakout Assignment from CS106a
    By tech8462 in forum New To Java
    Replies: 13
    Last Post: 10-09-2011, 03:38 AM
  2. Breakout game in the assignment 3 cs106
    By dage in forum New To Java
    Replies: 5
    Last Post: 03-16-2011, 05:07 PM
  3. Making a breakout Game
    By JavaIsSoEasy?? in forum Java Gaming
    Replies: 0
    Last Post: 03-05-2011, 10:52 AM
  4. Need help with Breakout game
    By tfitz666 in forum New To Java
    Replies: 9
    Last Post: 03-22-2010, 05:26 AM
  5. Breakout Game code help.
    By Ceasar in forum New To Java
    Replies: 6
    Last Post: 10-10-2009, 01:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •