Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package thegame;
- import java.util.*;
- import java.math.*;
- import javax.swing.*;
- import javafx.application.Application;
- import static javafx.application.Application.launch;
- import javafx.geometry.Insets;
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.control.TextField;
- import javafx.scene.image.Image;
- import javafx.scene.image.ImageView;
- import javafx.scene.layout.GridPane;
- import javafx.scene.layout.VBox;
- import javafx.stage.Modality;
- import javafx.stage.Stage;
- public class TheGame extends Application {
- Stage window;
- public static void main(String[] args) {
- launch(args);
- }
- @Override
- public void start(Stage primaryStage) throws Exception {
- window = primaryStage;
- window.setTitle("GridPanes");
- //GridPane with 10px padding around edge
- GridPane grid = new GridPane();
- grid.setPadding(new Insets(10, 10, 10, 10));
- grid.setVgap(8);
- grid.setHgap(10);
- //Name Label - constrains use (child, column, row)
- Label nameLabel = new Label("Username:");
- GridPane.setConstraints(nameLabel, 1, 0);
- //Name Input
- TextField nameInput = new TextField("Jamesus");
- GridPane.setConstraints(nameInput, 2, 0);
- //Password Label
- Label passLabel = new Label("Password:");
- GridPane.setConstraints(passLabel, 1, 1);
- //Password Input
- TextField passInput = new TextField();
- passInput.setPromptText("password");
- GridPane.setConstraints(passInput, 2, 1);
- //Login
- Button loginButton = new Button("Log In");
- GridPane.setConstraints(loginButton, 1, 2);
- Image Img = new Image("file:Vampire.png");
- ImageView Vampire = new ImageView(Img);
- Vampire.setFitWidth(300);
- Vampire.setFitHeight(250);
- //GridPane.getChildren().add(new ImageView(image));
- //Add everything to grid
- grid.getChildren().addAll(nameLabel, nameInput, passLabel, passInput, loginButton, Vampire);
- Scene scene = new Scene(grid, 650, 500);
- window.setScene(scene);
- window.show();
- Start();
- }
- protected Object[][][] Start() {
- Character Caller = new Character();
- Object[][][] Dude = Caller.OurGuy();
- Stage Window = new Stage();
- Window.initModality(Modality.APPLICATION_MODAL);
- Window.setTitle("Character Creation");
- Label Label = new Label();
- Label.setText("Fill out the options with what you want to carry throughout the game");
- Button YesButton = new Button("Done");
- TextField NameInput = new TextField("Your Name");
- TextField CharInput = new TextField("Character's Name");
- YesButton.setOnAction(e -> {
- Window.close();
- });
- VBox Layout = new VBox(10);
- Layout.getChildren().addAll(Label, YesButton, NameInput, CharInput);
- Layout.setAlignment(Pos.CENTER);
- Scene Scene = new Scene(Layout, 300, 250);
- Window.setScene(Scene);
- Window.showAndWait();
- return Dude;
- }
- protected void Welcome() {
- //very easy
- //Vampires S U C C
- //Welcome to Vampires S U C C, your goal is to survive long enough to travel
- //to the CDC in Georgia to escape the Vampire apocalypse.
- //References this method only once per playthrough
- JOptionPane.showMessageDialog(null, "Welcome to Vampires S U C C, your goal,"
- + " is to survive long enough to travel to the CDC in Georgia to,"
- + " escape the Vampire apocalypse. ");
- }
- protected void Story() {
- //very easy
- }
- protected void Travel() {
- JFrame frame = new JFrame("AnyThing");
- //Custom button text
- Object[] options = {"Travel",
- "Inventory",
- "Level Up",};
- int n = JOptionPane.showOptionDialog(frame,
- "Which Direction would you like to move ",
- "My Program",
- JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- options,
- options[2]);
- }
- protected void Lair1() {
- //intermediate
- }
- }
- class TheFight {
- //all of these are fairly difficult, but also a little bit copy paste once the first is done.
- protected void Encounter1() {
- }
- protected void Encounter2() {
- }
- protected void Encounter3() {
- }
- protected void Encounter4() {
- }
- protected void Encounter5() {
- }
- protected void Encounter6() {
- }
- protected void Encounter7() {
- }
- protected void Encounter8() {
- }
- protected void Encounter9() {
- }
- protected void Encounter10() {
- //boss fight
- }
- }
- class Character {
- //literal brain torture
- protected Object[][][] OurGuy() {
- Object[][][] Dude = {
- /*
- HP = Health
- ATK = Attack
- REC = Recovery/Passive health regen
- AGI = Speed/Agility
- */
- {// HP ATK REC AGI
- {50.0, 5.0, 3.0, 1.0},},
- //inventory, 10 slots
- {
- //Name(String),Damage(Double),HasEffect(Boolean),Effect(String),Positive(Boolean),Effect
- {},
- {},
- {},
- {},
- {},
- {},
- {},
- {},
- {},
- {}
- }
- };
- return Dude;
- }
- }
- class Vampire implements Required {
- @Override
- public String Name() {
- return "Vampire";
- }
- @Override
- public double Health() {
- Random rn = new Random();
- int n = 65 - 50 + 1;
- int i = rn.nextInt() % n;
- int HP = 50 + i;
- return HP;
- }
- @Override
- public boolean HasAbility() {
- return false;
- }
- @Override
- public String Ability() {
- return "";
- }
- @Override
- public boolean ToHero() {
- return false;
- }
- @Override
- public double AbilityEffToHP() {
- return 0.0;
- }
- }
- interface Required {
- public String Name();
- public double Health();
- public boolean HasAbility();
- public String Ability();
- public boolean ToHero();
- //if true that means it hits the hero, if false it hits both
- public double AbilityEffToHP();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement