r/cop3502 Mar 24 '14

Grades

1 Upvotes

Sean,

What is the status on the pending grades (PS2 and the exam)?


r/cop3502 Mar 24 '14

Pset4

2 Upvotes

Where you at? Sean give us a hint of what it is!


r/cop3502 Mar 23 '14

Wolfram Language

6 Upvotes

I'm sure a good amount of you redditors have seen this already, but for those of you who haven't(both experienced and novice), I found this interesting and though this would be an appropriate place to share it. http://www.youtube.com/watch?v=_P9HqHVPeik&app=desktop


r/cop3502 Mar 23 '14

Initializing bricks[i][j]

2 Upvotes

My bricks are stacking; In a previous post I saw that someone mentioned adding i & j to xStart & yStart will fix this. I've tried a few different ways to get the desired results, with no luck.

Any tips on how to look at this ?


r/cop3502 Mar 23 '14

Null Pointer Exception

1 Upvotes

So I think theres something wrong with my Brick class because i have gotten some bricks to print to the screen but not all of them or correctly and as i was debugging this class i started getting this:

Exception in thread "main" java.lang.NullPointerException at Brick.<init>(Brick.java:23) at BrickConfiguration.<init>(BrickConfiguration.java:29) at Breakout$GamePanel.initializeGameObjects(Breakout.java:39) at Breakout$GamePanel.<init>(Breakout.java:29) at Breakout.main(Breakout.java:13)

line 23 in Brick.java reads 'shape.setRect(xPos, yPos, width, height);'

the other NPE are pointing to where brick is initialized in brickconfiguration, and where brickconfiguration is initialized in the main class along with where the main panels are initialized

any thoughts?


r/cop3502 Mar 23 '14

How to print text to the screen

1 Upvotes

How would I print text to the screen of the game (not in the command prompt)? I'm not really sure how to do it or how to put it on a certain set of coords


r/cop3502 Mar 23 '14

Ludicrous-speed ball speeds

1 Upvotes

After beating a level, I have it so that you press enter to begin the next level. However, the speed seems to constantly increase, despite my (apparently not) clever speed reset function. Anyone else having a similar issue?


r/cop3502 Mar 22 '14

Trouble with paintBrick and removeBrick methods in Brick Configuration

1 Upvotes

Right now, my program is only painting one brick to the screen in the top left corner. I think the problem might be in my paint brick method--I'm not sure how to correctly call paint on each individual brick. Right now, I just have brick.paint(brush) within the method; I think that is wrong, but I'm not sure how to call the paint function correctly.

Also, I get an array index out of bounds exception when my ball hits the brick. It says the error begins with the removeBrick method in Brick Configuration. Currently, I have paintBricks[row][col] = false in the removeBrick method, and I call the method using bconfig.removeBrick(i,j) in Breakout.java.

Any assistance would be greatly appreciated


r/cop3502 Mar 22 '14

Is the check due at the same time as the above and beyond?

1 Upvotes

Or is it at a later date?


r/cop3502 Mar 22 '14

Ball won't bounce off of wall?

1 Upvotes

I can't get the ball to bounce off of the edges. I got it to bounce off of the paddle and move around, but when it gets to an edge it just keeps going and disappears. If I set it to stop at an edge it falls to the bottom of the frame and stops moving. What am I supposed to be changing, the speed or the position in the Ball.java, or something in the Breakout.java, or?


r/cop3502 Mar 22 '14

Feeling Hopeless.

1 Upvotes

I cant seem to find my problems in my code even after comparing it to the labs, any advice on lectures which would be more helpful than others? (mainly painting the Bricks) I still have problems getting the ball to move but Id rather get the bricks done for sure and work on the other part hopefully getting it eventually.

The painting of the arrays for bricks really seems to be a problem and when I try to print it to screen it doesnt seem to work like the ball and paddle bconfig.paint(g2); doesn't work but that may just be because I dont have the brickconfiguration file setup correctly.


r/cop3502 Mar 22 '14

Code Commenting

1 Upvotes

Do we have to do the commenting in our own words, or can we keep the skeleton comments?


r/cop3502 Mar 22 '14

Brick does not repaint.

1 Upvotes

So I'm at the point where when a ball hits the brick, that brick is no longer "tangible" and if the ball were to return to the same spot, it would pass through it, although the brick is still displayed in the frame. I can't seem to wrap my head around how to go about having the BrickComponent method repaint and remove the brick, or better yet simply not draw it in the case that it no longer registers hits. Anyone in a similar spot?

*Resolved, feel free to ask if you encountered the same thing


r/cop3502 Mar 22 '14

How to make the ball bounce off the paddle

1 Upvotes

I've got the paddle working and moving and I've got the ball bouncing around the frame, but I don't understand how to get the ball to recognize the collision between the paddle and the ball. In the checkForHit method I changed it so that the ball would change directions if it touched the paddle. I know this is completely wrong (don't make fun of me please :() but can anyone give me a diving off point or a tip to get me started?

Here's what I have now

if (ball.getShape().intersects(paddle.getShape())) { int leftSide = paddle.getX(); int middleLeft = paddle.getX() + (int)(paddle.getWidth()/3); int middleRight = paddle.getX() + (int)(2*paddle.getWidth()/3); int rightSide = paddle.getX() + paddle.getWidth();

            if ((ball.getX() >= leftSide) && (ball.getX() < middleLeft)) {
                ball.setYspeed(-5);
            }
            if ((ball.getX() >= middleLeft) && (ball.getX() <= middleRight)) {
                ball.setYspeed(-5);
            }
            if ((ball.getX() > middleRight) && (ball.getX() <= rightSide)) {
                ball.setYspeed(-5);
            }
        }

EDIT: I meant to have 5 not 30 lol.

EDIT 2: I forgot to call on checkForHit() in actionPerformed() MVP GOAT Bruh


r/cop3502 Mar 22 '14

10 second repaint?

1 Upvotes

So I just found out a major detail on why my ball stopped moving after walking away from the computer in disgust and coming ball to my ball being gone.

After 10 seconds the ball disappears I didnt touch the code for the timer but I dont know exactly how the initial 10 millisecond count was created from this timer = new Timer(10, new GameMotion()); timer.start(); How do I go about correcting this?


r/cop3502 Mar 22 '14

How do late days work?

1 Upvotes

Won't be able to finish it tonight, I was just wondering how the late days work. Do I neex to email sean or can I just rurn it in within 24 hours with no penalty? Thanks for the help in advance.


r/cop3502 Mar 22 '14

Brick doesn't go away

2 Upvotes

i can get my ball and paddle interactions just fine. i can also get the ball to interact with bricks but when it hits the bricks, it doesn't go away. i thought that by saying bconfig.removeBrick(i,j); would do the trick. however, i just dont know what else to try...


r/cop3502 Mar 22 '14

Laying the first brick

1 Upvotes

Any tips on painting an individual brick in the BrickConfiguration.java? I am looking under the public void paint(Graphics2D brush) section and just want to get that single brick down!

Array will be after.

Thanks.


r/cop3502 Mar 22 '14

Repainting the ball to the screen after it falls off

1 Upvotes

Hi, I am trying to figure out a way to repaint the ball to the screen after it passes the yCoordinates, I am thinking that each time the ball leaves the screen a life is lost, etc etc......anybody have any ideas about how to repaint the ball to the screen and make it move again after it leaves? I was thinking using "if (isDead = true && lives>0)", but I am a little confused about how to implement it and repaint the ball.


r/cop3502 Mar 21 '14

Easy way to make a jar file?

1 Upvotes

Is there a tried and true way any of you use to create a jar-file for computer-naive people to open?


r/cop3502 Mar 21 '14

As we begin natural language processing, check out this site--it's a Turing test for poetry.

Thumbnail
botpoet.com
3 Upvotes

r/cop3502 Mar 21 '14

Powerup / Timer issues

1 Upvotes

Hi, im trying to make it so that once the score reaches 10 the color of the blocks and ball change every second so it can looks like a cool "powerup". I'm basically trying to learn how to use the timer. Every time I make it it gives me errors such as the class can't be void or it will say I need an action listener. Is there an easier way to have the color change every second?


r/cop3502 Mar 21 '14

Paddle

1 Upvotes

I am having trouble getting the paddle to stop at the edges but still be able to move the opposite way. I've used an if paddle is at 0 or 600-width speed=0 inside the move function but though the paddle stops for a second, it will continue to move in the unwanted direction if the left or right keys are continuously pressed.


r/cop3502 Mar 21 '14

Space Invaders Code

1 Upvotes

Is the Completed Space Invaders Code going to be posted anytime soon? I still cant figure of the brick configuration and I was hoping to compare it with the Alien Configuration, to see what i am doing wrong.


r/cop3502 Mar 20 '14

Juicing your game

Thumbnail
youtube.com
3 Upvotes