1 Replies - 581 Views - Last Post: 07 August 2017 - 12:49 PM Rate Topic: -----

#1 Syed Asad  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-July 17

Paddle Movement

Posted 07 August 2017 - 12:48 PM

Hello guyz, I want to make Pong game I am having trouble with my paddles I've tried so my tutorials but nothing worked I've been working on it for 2 weeks I want to move my paddle UP and Down how can I do it? please help me Thanks,


package game;

import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

/**
 *
 * @author Zaidi
 */
public class Main extends Application {
    
    @Override
    public void start(Stage primaryStage){
       
        Circle cir = new Circle();
        cir.setRadius(10);
        cir.setFill(Color.RED);
        Rectangle rec1 = new Rectangle();
        rec1.setHeight(50);
        rec1.setWidth(10);
        rec1.setFill(Color.RED);
        
  
        Rectangle rec2 = new Rectangle();
        rec2.setHeight(50);
        rec2.setWidth(10);
        rec2.setFill(Color.RED);
        
        BorderPane root = new BorderPane();
        root.setCenter(cir);
        root.setLeft(rec1);
        root.setRight(rec2);
        
        
        Scene scene = new Scene(root, 400, 400);
        
        primaryStage.setTitle("Hello World!");
        root.setStyle("-fx-background-color: BLACK");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    
    public static void main(String[] args) 
    {
        launch(args);
    }
    
}




Is This A Good Question/Topic? 0
  • +

Replies To: Paddle Movement

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13493
  • View blog
  • Posts: 53,901
  • Joined: 12-June 08

Re: Paddle Movement

Posted 07 August 2017 - 12:49 PM

What seems to be the issue?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1