Java - Making Pong With Our Game Engine!

preview_player
Показать описание
Hey everyone, so here is the first game we are making using the game engine we made in the last video! Hope it helps!

-Baseball435
Рекомендации по теме
Комментарии
Автор

I didnt see any control over time that was introduced. This can cause real issues. In your loop, it seems it will be dependent on the speed of your pc, and will go as fast as possible. Then you directly apply velocities in your update code without considering the time that has passed since the last update took place. To increase smoothness, consider timing the distance between update calls, then multiply your velocities by a factor of this time.

mscott
Автор

A good effort, but there is some pretty bad design going on here. At first I was kinda impressed when you starting creating an interface and deriving abstract classes. Then you kinda got lazy when deriving a class, and just providing your own definition for much of what you were supposed to override. If you only have one ball, and both paddles need access to it, consider making the ball static, or give the paddle class a reference to the ball when you construct it.

mscott
Автор

i don not get it...


GameScreen
public void onDraw(Graphics2D g2d) {
  g2d.setColor(Color.blue);
  g2d.fillRect(0, 0, 800, 600);
  g2d.fillOval(0, 0, 0, 0);
  ball.draw(g2d);

}

I have to put in this line else i get this error:

Exception in thread "AWT-EventQueue-0"
  at
  at
  at Source)
  at Source)
  at Source)



It seems like my g2d is empty.. but wen i print it out its not. Sow i have to draw an empty fillOval before i can call my ball...

Yoieh
Автор

the problem on the ball was not on the existance of setX or the setY, was because the assignment of the setX and setY keep the collision valid:

example:
if (570 + 30 > 600) {
  setX(600); // <--- this still validate the previous collision condition !!! 
}

ffdelight
Автор

Hey, I have done everything like you did, I have actually seen the first part of the video since I did not want to make that kind of Game, but whenever I try to make the player class for examle and call the update function in the the onUpdate method in my screen, it gives the this error in the console:


at
at
at java.lang.Thread.run(Unknown Source)

Please tell me what I did wrong because I can't figure it out myself. Please HELP!

ichhabsdrauf
Автор

I'm currently trying to optimize this project, but I hit a major snag. Moving all methods, variables and fields as far up in the inheritance hierarchy as possible, my player paddle cannot be altered in it's position on the Y-axis, and instead of moving horizontally, it moves diagonally. Can any one explain this, cus I'm not experienced enough at Java to debug it.

TheRealPrecaseptica
Автор

Once I click once it keeps thinking I am clicking...

InfernoKaygaming
Автор

you know that you dont have to type @override right? lol

GLMbackwards
Автор

Your rpg map maker link don't download

DRAGONMASTER