Ik ga morgenvroeg weer een poging doen op forel, wel 5 uur m n nest uit.


Jurrie schreef:Wat is "forel"?Ik ga morgenvroeg weer een poging doen op forel, wel 5 uur m n nest uit.
Maartenf schreef:Zon beest met kieuwe die in yet water zwemtWat is "forel"?Eerdere citaten tonen
Jurrie schreef:Ik ga morgenvroeg weer een poging doen op forel, wel 5 uur m n nest uit.
Christopher schreef:Heb wel een live fragment er van.Heeft iemand download linkje van Gers Pardoel - Zijn ? Kan hem niet vinden op het net
Raaoul schreef:Nice!Ja dat ken ik, maar heb het nu niet nodig.Eerdere citaten tonen
Maartenf schreef:@raaoul: Kan jij jdbc?
Mijn 3D game met ultra goede gameervaring met super graphics is trouwens af!!
YouTube-filmpje
Nee grapjeIs mijn eerste OpenGL dingetje dat ik gemaakt heb, ik probeer een simpele platformer te maken
Ik heb nu al pong 2D af. Zal ik ook eens een filmpje maken?
Mijn code is wel wat langer! 
Maartenf schreef:Ik hoop dat je niet alles in 1 class zet xDNice!Eerdere citaten tonen
Raaoul schreef:Ja dat ken ik, maar heb het nu niet nodig.Eerdere citaten tonen
Maartenf schreef:@raaoul: Kan jij jdbc?
Mijn 3D game met ultra goede gameervaring met super graphics is trouwens af!!
YouTube-filmpje
Nee grapjeIs mijn eerste OpenGL dingetje dat ik gemaakt heb, ik probeer een simpele platformer te maken
Ik heb nu al pong 2D af. Zal ik ook eens een filmpje maken?
Mijn code is wel wat langer!

Maartenf schreef:Swing gebruik je toch niet voor een game? Swing is meer voor GUIs in banken, kantoren, ...Nee, in totaal heb ik 3 classes. Het spel werkt met een mouseMotionListener en maakt gebruik van swing qua GUI.
Robindesign schreef:Vaak maken apps ook gebruik van internet?Wat is zuiniger voor je accu een app of website gebruiken??
.
Sanderc schreef:Wat heb ik voor een rare broer.
Hij is een uur geleden gaan slapen en ik kom de kamer binnen.
Op eens brabbeld hij iets luid op en gaat rechtop zitten. Ik vraag, wat doet ge? Hij antwoord met dat hij wakker is en zegt dat hij al lang wakker is. Ik zeg dan dat hij weer aan het praten is en zijn slaap en dan wordt hij helemaal agressief en valt hij oppeens neer in bed en slaapt terug. Nu praat hij nog steeds en maakt hij rare geluiden met zijn beugel
@raaoul:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
public class Pong extends JFrame implements MouseMotionListener, ActionListener {
private JPanel panel;
private JButton button;
protected boolean mouse = true;
protected Ball ball;
protected int nowMouseX = 0;
protected int controlTheMouseX;
private boolean status;
private int score = 1;
public static void main(String[] args) {
Pong frame = new Pong();
frame.setSize(476, 284);
frame.createGUI();
frame.setResizable(false);
frame.setTitle("Pong");
frame.setLocationRelativeTo(null);
frame.show();
}
private void createGUI() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container window = getContentPane();
window.setLayout(new FlowLayout());
panel = new JPanel();
panel.setPreferredSize(new Dimension(450, 220));
panel.setBackground(Color.GREEN);
panel.addMouseMotionListener(this);
window.add(panel);
button = new JButton("New Game");
button.addActionListener(this);
window.add(button);
}
public void mouseDragged(MouseEvent e) {
}
public void stopGame() {
JOptionPane.showMessageDialog(null, "You have Lost!");
System.exit(0);
}
public void winStopGame() {
JOptionPane.showMessageDialog(null, "You have Won!");
System.exit(0);
}
private void draw() {
Graphics paper = panel.getGraphics();
paper.setColor(Color.green);
paper.fillRect(0, 190, 450, 10);
paper.setColor(Color.white);
paper.fillRoundRect(nowMouseX, 190, 36, 10, 5, 5);
}
protected void clearPanel(JPanel panel) {
Graphics paper = panel.getGraphics();
int panelWidth = panel.getWidth();
int panelHeight = panel.getHeight();
paper.setColor(Color.green);
paper.drawRect(0, 0, panelWidth, panelHeight);
}
public int getMouseX() {
return nowMouseX;
}
public void mouseMoved(MouseEvent e) {
Graphics paper = panel.getGraphics();
if (!mouse) {
controlTheMouseX = e.getX();
nowMouseX = e.getX();
draw();
ball.setMouseX(e.getX());
}
}
public void actionPerformed(ActionEvent e) {
Graphics paper = panel.getGraphics();
paper.setColor(Color.DARK_GRAY);
paper.fillRect(0, 200, 450, 20);
paper.setColor(Color.WHITE);
Font font = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
paper.setFont(font);
paper.drawString("New Game Started!", 1, 219);
if (mouse) {
ball = new Ball(panel);
ball.start();
ball.changeDiameter(15);
status = true;
mouse = false;
}
}
public void newBall() {
//Not finished yet!
}
class Ball extends Thread {
private Graphics graphics;
private int x = 0;
private int y = 0;
private boolean running = true;
private int xChange = 5;
private int yChange = 5;
private int diameter = 15;
private Color color = Color.yellow;
private Control control;
private int theCurrentMouseX;
private Random random;
private int theCurrentScore;
private int theDelay = 35;
public Ball(JPanel panel) {
graphics = panel.getGraphics();
}
public void randomColor() {
random = new Random();
int amount = random.nextInt(3);
if (amount == 0) {
color = Color.black;
}
if (amount == 1) {
color = Color.magenta;
}
if (amount == 2) {
color = Color.cyan;
}
if (amount == 3) {
color = Color.blue;
}
}
public void setMouseX(int set) {
theCurrentMouseX = set;
}
public void changeColor(Color c) {
color = c;
}
public Color getColor() {
return color;
}
public void changeDiameter(int d) {
if (d % 5 == 0) {
diameter = d;
}
else {
JOptionPane.showMessageDialog(null, "The value of changeDiameter isnt an integer that can share 5");
}
}
public int getDiameter() {
return diameter;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public void stopBall() {
running = false;
}
public void goBall() {
running = true;
}
public void run() {
while (running) {
control = new Control(getX(), getY(), theCurrentMouseX, getDiameter(), theCurrentScore, graphics);
delete();
move();
bounce();
draw();
delay();
theCurrentScore = control.getScore();
}
}
private void delete() {
graphics.setColor(Color.green);
graphics.fillOval(x,y,diameter,diameter);
}
private void move() {
x = x + xChange;
y = y + yChange;
}
private void bounce() {
//Handles x
if ((x == 0) || (x == 450 - diameter)) {
xChange = -xChange;
}
//Handles y
if ((y == 0) || (y == 190 - diameter)) {
yChange = -yChange;
}
}
private void draw() {
graphics.setColor(color);
graphics.fillOval(x,y,diameter,diameter);
}
private void delay() {
try {
Thread.sleep(theDelay);
}
catch (InterruptedException e) {
}
}
public void setDelay(int del) {
theDelay = del;
}
public int getDelay() {
return theDelay;
}
}
class Control extends Pong {
private int theBallX;
private int theBallY;
private int theMouseX;
private int theDiameter;
private int realBallX = 0;
private int realBallY = 0;
private int theScore = 1;
private Graphics graphics;
public Control(int ballX, int ballY, int mouseX, int diameter, int score, Graphics g) {
theBallX = ballX + diameter / 2;
theBallY = ballY;
theDiameter = diameter;
theScore = score;
graphics = g;
realBallX = ballX;
realBallY = ballY;
theMouseX = mouseX + 18;
controlLose();
}
public int getScore() {
return theScore;
}
private void controlLose() {
//Handles x
if (theBallY == 190 - theDiameter) {
if ((theMouseX + 18 + 10 <= theBallX) || (theMouseX - 18 - 10 >= theBallX)) {
theScore--;
graphics.setColor(Color.DARK_GRAY);
graphics.fillRect(0, 200, 450, 20);
graphics.setColor(Color.white);
Font font = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
graphics.setFont(font);
graphics.drawString("Score: " + Integer.toString(theScore) + " Missed Ball :(", 1, 219);
newBall();
if (theScore <= 0) {
Font font2 = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
graphics.setFont(font2);
graphics.setColor(Color.DARK_GRAY);
graphics.fillRect(0, 200, 450, 20);
graphics.setColor(Color.white);
graphics.drawString("Score: 0 You have Lost!", 1, 219);
stopGame();
}
}
else {
theScore++;
graphics.setColor(Color.DARK_GRAY);
graphics.fillRect(0, 200, 450, 20);
graphics.setColor(Color.white);
if (theScore == 10) {
Font font = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
graphics.setFont(font);
graphics.drawString("Score: " + Integer.toString(theScore) + " Match Point!", 1, 219);
}
else if (theScore < 10) {
Font font = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
graphics.setFont(font);
graphics.drawString("Score: " + Integer.toString(theScore), 1, 219);
}
if (theScore == 11) {
Font font = new Font("tahoma", Font.LAYOUT_LEFT_TO_RIGHT, 18);
graphics.setFont(font);
graphics.drawString("Score: 11 You have Won!", 1, 219);
winGame();
}
}
}
else {
}
}
private void controlLoseOrWin() {
if (theScore == 0) {
lostGame();
}
else {
if (theScore == 3) {
winGame();
}
}
}
public void winGame() {
winStopGame();
}
public void lostGame() {
stopGame();
}
}
}
Sanderc schreef:Je weet zeker dat alles oké is?Wat heb ik voor een rare broer.
Hij is een uur geleden gaan slapen en ik kom de kamer binnen.
Op eens brabbeld hij iets luid op en gaat rechtop zitten. Ik vraag, wat doet ge? Hij antwoord met dat hij wakker is en zegt dat hij al lang wakker is. Ik zeg dan dat hij weer aan het praten is en zijn slaap en dan wordt hij helemaal agressief en valt hij oppeens neer in bed en slaapt terug. Nu praat hij nog steeds en maakt hij rare geluiden met zijn beugel