Code Monkey home page Code Monkey logo

java-2d-medieval-rpg's Introduction

Tiny Adventure(Java 2D RPG)

Снимок экрана 2023-09-15 192637 Снимок экрана 2023-09-15 192744

What is implemented?

  • Health/Mana bars
  • Player Status
  • Inventory
  • Project tiles
  • Options(fullscreen, volume mix
  • Save option
  • NPC
  • Pause statement
  • Advanced dialogues
  • Advanced game events
  • Mobs
  • A* pathfinding for npc/mobs
  • Knockback effect on attack
  • Guard/parry fight
  • Dungeon+puzzles
  • Boss spawn
  • Object detection+stackable items
  • Ligth effect + environment light
  • Save/Load option, map+radar

What will be next?

  • Finish the game design, music, SE and plot of the current game.
  • Make a random chance of dropping another data source (draw multiple options) and put 50%
  • On the map, make a bay and a ship, where, after payment, you are transported to another island on the same map
  • Make smarter AI behavior while they're walking

Inspiration

When I attended IT courses, I was highly motivated to complete tasks with not just 100 percent quality, but 200 percent. One day, we received our homework assignment, which involved creating an RPG game in Java console. This sparked an idea in my mind: could I develop the same game but with a user interface (UI) instead of just a console interface? Since then, it has been one year of development, and I am still making progress.

java-2d-medieval-rpg's People

Contributors

sem24 avatar viktorvoloshko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

java-2d-medieval-rpg's Issues

Advanced AI logic

Make smarter AI behavior while walking, possibly confer with GPT chat

Game design features for better user experience

Make a map appear as you progress through it
Make a random chance of another generation of the dungeon (draw several options) and put 50% chance
Draw one large map, which is divided into several small locations where you can teleport to without changing the map
On the main map, make a bay and a ship, where, having paid, you are transported to another island on the same map

Some suggestions of main story

  • Make the ending of the game so that after the victory the person woke up in the real world
  • Use default zelda story with undertale mix

Music problem when enter new dungeon

Fix when, after loading a save on another map, music turns on for the first map
(Most likely, the appearance and the map will not save for a simple)

Mini games for world

Add a mini game where you have to play the music correctly (by stepping on it) and then the door will open. You can listen by pressing the button.
Add a puzzle where you will fall if you step on it wrong(as in undertale)

Add the introductory video with captivating lore elements

NEW OPTION
Instead of video, create the class that will have several images (so it will be like slideshow) with bg music and
draw that images(create them in photoshop/sony vegas) to show the "lore" of game. Also use transactional method to change the images like "fade out".

OLD OPTION
Use long enter press to skip the video.
Tips
Tips
Tips

ChatGPT Tips:

To display a video as the first screen of your Java Swing application, you can use a JFrame to create the main window and a JLabel to display the video. You can then use a library like vlcj or JMF to play the video. Here's an example of how you can achieve this:

  1. First, make sure you have the necessary libraries in your project. You can add them as dependencies using your preferred build tool (e.g., Maven or Gradle). For example, if you're using Maven, add the following dependencies to your pom.xml file:

  2. Create a new class, let's say VideoPlayer, that extends JFrame and contains a JLabel for displaying the video. Add the necessary imports:

java
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayerComponent;

import javax.swing.;
import java.awt.
;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class VideoPlayer extends JFrame {
private final EmbeddedMediaPlayer mediaPlayer;

public VideoPlayer(String videoPath) {
    // Set up the main window
    setTitle("Video Player");
    setSize(800, 600);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Create the media player component
    EmbeddedMediaPlayerComponent mediaPlayerComponent = new EmbeddedMediaPlayerComponent();
    mediaPlayer = mediaPlayerComponent.getMediaPlayer();

    // Add the media player component to the frame
    Container contentPane = getContentPane();
    contentPane.add(mediaPlayerComponent, BorderLayout.CENTER);

    // Play the video
    mediaPlayer.playMedia(videoPath);

    // Add a window listener to stop the player and close the application when the window is closed
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            mediaPlayer.stop();
            mediaPlayer.release();
            super.windowClosing(e);
        }
    });
}

public static void main(String[] args) {
    SwingUtilities.invokeLater(() -> {
        // Replace "path/to/video.mp4" with the actual path to your video file
        VideoPlayer player = new VideoPlayer("path/to/video.mp4");
        player.setVisible(true);
    });
}

}

  1. Replace "path/to/video.mp4" with the actual path to your video file in the main method.

  2. Compile and run the application. The video should start playing automatically, and the application window will close when the video finishes or when the user closes the window.

Make sure to replace "path/to/video.mp4" with the actual path to your video file. Also, ensure that you have the necessary codecs and dependencies installed for video playback to work correctly.

If you prefer not to use any external libraries, you can use the built-in support for playing videos in Java Swing using the JEditorPane class. Here's an example of how you can achieve this:

java
import javax.swing.;
import java.awt.
;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;

public class VideoPlayer extends JFrame {
private JEditorPane editorPane;

public VideoPlayer(String videoPath) {
    // Set up the main window
    setTitle("Video Player");
    setSize(800, 600);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    // Create the editor pane
    editorPane = new JEditorPane();
    editorPane.setEditable(false);
    editorPane.setContentType("text/html");

    // Load the video HTML into the editor pane
    try {
        File videoFile = new File(videoPath);
        String videoURL = videoFile.toURI().toURL().toString();
        editorPane.setText("<html><body><video src='" + videoURL + "' autoplay></video></body></html>");
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    // Add the editor pane to the frame
    Container contentPane = getContentPane();
    contentPane.add(new JScrollPane(editorPane), BorderLayout.CENTER);

    // Add a window listener to close the application when the window is closed
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            super.windowClosing(e);
            System.exit(0);
        }
    });
}

public static void main(String[] args) {
    SwingUtilities.invokeLater(() -> {
        // Replace "path/to/video.mp4" with the actual path to your video file
        VideoPlayer player = new VideoPlayer("path/to/video.mp4");
        player.setVisible(true);
    });
}

}

In this example, the JEditorPane is used to display an HTML document that contains an embedded

Make sure to replace "path/to/video.mp4" with the actual path to your video file.

Compile and run the application, and the video should start playing automatically when the application opens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.