Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Were Should I move on from this point?

  1. #1
    Junior Member
    Join Date
    Sep 2018
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Were Should I move on from this point?

    So I've learned how to do various commands such as if then statements and Javax.swing (the java text boxes) and I honestly don't know were to progress to after this point. Am I good enough to start developing with something like J-frame, or is there other things I should learn before moving onto something like that. (also note im planning to stick with just 2D).

    Can't attach my most recent file to the thread (keeps saying its a invalid file) so the code is here (its just a simple RPG fight with some basic attack commands
    A = attack
    H = heal
    M = magic)
    Code
    import javax.swing.JOptionPane;
     
    public class Battlebackup {
     
    public static void main(String[]args) {
    	JOptionPane myIO = new JOptionPane ();
    	myIO.showMessageDialog(null,"a slimey boi starts to sneak up on you");
    	int turn = 0;
    	int PHP = 10;
    	int EHP = 5;
    	int MP = 3;
    	int none = 0;
    	while (turn < 100) {
     
     
     
    	String inputText = myIO.showInputDialog("What do you do?" + " HP:" + PHP + " MP:" + MP );
     
     
    	if (inputText.equals("a")){
    		myIO.showMessageDialog(null,"you do a friggin shank boi, inflicting one damage to the slime");
    		EHP -= 1;
    		 none += 1;
     
    	}else {
     
    	}
    	if (MP > 0) {
    	if (inputText.equals("m")){
    		myIO.showMessageDialog(null,"you throw your book of harry potter spells, dealing 3 dmg ");
    		EHP -= 3;
    	MP -= 1;
    	 none += 1;
    	}else {
     
    	}
    	}else {
     
    	}
    	if (MP > 0) {
    	if (inputText.equals("h")){
    		myIO.showMessageDialog(null,"you eat your book of harry potter spells, gaining 8hp");
    		PHP += 8;
    	MP -= 1;
    	 none += 1;
    	}else {
     
    	}
    	}else {
     
    	}
     
     
     
    	if (none > 0) {
    		none -= 1;
    	}else {
    		myIO.showMessageDialog(null,"you do nothin, great");
     
    	}
     
    	myIO.showMessageDialog(null,"Slimy boi takes out a slimy gun and shoots you, dealing 3 damage");
    	PHP -= 3;
     
    	if (EHP > 0) {
     
    	}else {
    		myIO.showMessageDialog(null,"you defeat the slime and get 69gold xd");
    		turn =+ 1000;
    	}
    	if (PHP > 0) {
     
    	}else {
    		myIO.showMessageDialog(null,"you died");
    		turn =+ 1000;
     
    	}
    }
    }
    }

  2. #2
    Member
    Join Date
    Sep 2018
    Location
    Virginia
    Posts
    284
    My Mood
    Cool
    Thanks
    0
    Thanked 38 Times in 36 Posts

    Default Re: Were Should I move on from this point?

    Before you delve into Swing I recommend that you become familiar with Lists, Maps, and Sets and their various implementations. They will inevitably be used in your future endeavors.

    Regards,
    Jim

  3. The Following User Says Thank You to jim829 For This Useful Post:

    CJ_sucks_at_programin (October 3rd, 2018)

Similar Threads

  1. Replies: 1
    Last Post: October 1st, 2014, 09:26 PM
  2. Move an object
    By jan4185 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 7th, 2013, 02:43 PM
  3. Why can't I get my cards to move?
    By Skynet928 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 6th, 2013, 08:30 PM
  4. [SOLVED] Images won't move
    By ercfrtz in forum AWT / Java Swing
    Replies: 1
    Last Post: July 5th, 2012, 06:14 PM
  5. [SOLVED] Things Won't Move
    By zeraxis in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 2nd, 2011, 08:46 AM