• Login
  • Register
Hello There, Guest!

Username:

Password:

Remember me

hasło Lost Password?

  • Forum
  • Search
  • Member List
  • Play
  • Hiscores
glowna Rune2006 → Other → Gaming v
1 2 Next »
→

DragonWorld


Post Reply
Threaded Mode | Linear Mode
DragonWorld
dsun
Super Moderators
  • Posts:1,006
  • Joined:Mar 2013
  • Reputation:30
03-19-2013 04:20 AM DragonWorld
Post: #1
A little text based game made by me!

http://dsunscape.webs.com/apps/forums/to...ragonworld

Perhaps give it a try if you're into text-based rpg? Tongue



If you tried it out, and would like to learn how to make a text game in Java, improve it or whatever, let me know! (it's very easy since it's only basic stuff Smile)



[Image: 2ks9S]


[Image: 2krUn]


[Image: 2ks7v]


[Image: 2ks2l]


[Image: 2ks1y]


[Image: 2kscz]


[Image: 2ksea]


Running on henning's linux:
[Image: rsz_screenshotpct20frompct202013-03-19pc...ct3a43.png]

(This post was last modified: 04-24-2013 07:47 AM by dsun.)
top
www find
quote
Sully
Minotaur Member

  • Posts:75
  • Joined:Mar 2013
  • Reputation:2
03-19-2013 04:22 AM RE: DragonWorld
Post: #2
Sure man, let's see how good you're at this kind of stuff C:

[Image: BvDUH5W.gif]
[Image: 13547227060725.gif]

top
find
quote
Yogosun
Minotaur Member
  • Posts:217
  • Joined:Mar 2013
  • Reputation:4
03-19-2013 04:23 AM RE: DragonWorld
Post: #3
Why not Smile

[Image: lxOQ2NP.png]
Huge credits to ᴋᴏʀɴsʟɪᴘᴋɴ for signature :3

[Image: e3287894db5f6fcdef50ac597460a99e_large.gif]

top
find
quote
Rarity


  • Posts:9
  • Joined:Mar 2013
  • Reputation:2
03-19-2013 06:41 PM RE: DragonWorld
Post: #4
Why don't I die at 0 health? Does it have to go negative?

top
find
quote
Henning B
Skeletal Member
  • Posts:538
  • Joined:Mar 2013
  • Reputation:9
03-19-2013 06:54 PM RE: DragonWorld
Post: #5
(03-19-2013 06:41 PM)Rarity Wrote:  Why don't I die at 0 health? Does it have to go negative?

I dont know, never played it...

Best Regards
~Henning B.
Married to Dsun.
[Image: Resubmit.png]
Need Help?

top
find
quote
dsun
Super Moderators
  • Posts:1,006
  • Joined:Mar 2013
  • Reputation:30
03-19-2013 07:45 PM RE: DragonWorld
Post: #6
(03-19-2013 06:41 PM)Rarity Wrote:  Why don't I die at 0 health? Does it have to go negative?

}else if(hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();


^as u can see, you should die when you hit 0 or less HP

but the problem is, it's turn based.
the monster first hits you, and then you hit the monster no matter what your hp is.

in other words, if the monster hits you and your hp is 0 or less, you will still attack for the fight to end.
therefore, you may kill the monster while you have 0 hp or less, and still survive. i haven't got to fix this yet.


I just found this code:

}else if(hp <= 0 && m_hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();

and realized that i put it in the wrong place... (so it wont really do anything, oh well)
what the code basically means, if you and the monster reach 0 or less HP at the same time, you only will die..

i cant fix this now, too much work Big Grin

if you'd like to fix or improve stuff in the game, feel free to do so!
here's the code: pastebin.com/nkTqCjAG


thanks for playing!


If you still couldn't understand the logic, here's more of the code to get a better idea (hopefully you know at least some java Wink):

public static void phoenix() throws InterruptedException{
fight = true;
m_hp = 50;
System.out.println(mons[8]);

while(fight == true){
m_dmg = r.nextInt(5);
goldDrop = 1+r.nextInt(100);
monsterDrop = 1+r.nextInt(15);
heal = 1+r.nextInt(4);
healAmount = 1+r.nextInt(7);
dmg = r.nextInt(str);
dmg *= 0.5;
healSelf = 1+r.nextInt(3);
healSelfAmount = 1+r.nextInt(5);
System.out.println("Phoenix (HP:" + m_hp + "/50) does " + m_dmg + " damage");
if(heal == 1){
System.out.println("+" + healAmount + " heal!");
}
hp -= m_dmg;
System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
m_hp -= dmg;
if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
System.out.println(healSelfAmount + "+ heal!");
hp += healSelfAmount;
if(hp > hpMax){
hp = hpMax;
}
}
System.out.println();
Thread.sleep(1500);

if(m_hp <= 0){
fight = false;
System.out.println("You killed the phoenix\nGained 100 exp\nDrops:\nGold x" + goldDrop);
if(monsterDrop == 1 && phoenixPet == false){
System.out.println("Phoenix pet");
phoenixPet = true;
}
gold += goldDrop;
exp += 100;
lvlsystem();
}else if(hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();
}else if(hp <= 0 && m_hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();
}
}
}

(This post was last modified: 03-19-2013 07:57 PM by dsun.)
top
www find
quote
Henning B
Skeletal Member
  • Posts:538
  • Joined:Mar 2013
  • Reputation:9
03-19-2013 08:55 PM RE: DragonWorld
Post: #7
(03-19-2013 07:45 PM)dsun Wrote:  
(03-19-2013 06:41 PM)Rarity Wrote:  Why don't I die at 0 health? Does it have to go negative?

}else if(hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();


^as u can see, you should die when you hit 0 or less HP

but the problem is, it's turn based.
the monster first hits you, and then you hit the monster no matter what your hp is.

in other words, if the monster hits you and your hp is 0 or less, you will still attack for the fight to end.
therefore, you may kill the monster while you have 0 hp or less, and still survive. i haven't got to fix this yet.


I just found this code:

}else if(hp <= 0 && m_hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();

and realized that i put it in the wrong place... (so it wont really do anything, oh well)
what the code basically means, if you and the monster reach 0 or less HP at the same time, you only will die..

i cant fix this now, too much work Big Grin

if you'd like to fix or improve stuff in the game, feel free to do so!
here's the code: pastebin.com/nkTqCjAG


thanks for playing!


If you still couldn't understand the logic, here's more of the code to get a better idea (hopefully you know at least some java Wink):

public static void phoenix() throws InterruptedException{
fight = true;
m_hp = 50;
System.out.println(mons[8]);

while(fight == true){
m_dmg = r.nextInt(5);
goldDrop = 1+r.nextInt(100);
monsterDrop = 1+r.nextInt(15);
heal = 1+r.nextInt(4);
healAmount = 1+r.nextInt(7);
dmg = r.nextInt(str);
dmg *= 0.5;
healSelf = 1+r.nextInt(3);
healSelfAmount = 1+r.nextInt(5);
System.out.println("Phoenix (HP:" + m_hp + "/50) does " + m_dmg + " damage");
if(heal == 1){
System.out.println("+" + healAmount + " heal!");
}
hp -= m_dmg;
System.out.println(name + " (HP:" + hp + "/" + hpMax + ") does " + dmg + " damage");
m_hp -= dmg;
if(phoenixPetEquipped == true && hp < hpMax && healSelf == 1){
System.out.println(healSelfAmount + "+ heal!");
hp += healSelfAmount;
if(hp > hpMax){
hp = hpMax;
}
}
System.out.println();
Thread.sleep(1500);

if(m_hp <= 0){
fight = false;
System.out.println("You killed the phoenix\nGained 100 exp\nDrops:\nGold x" + goldDrop);
if(monsterDrop == 1 && phoenixPet == false){
System.out.println("Phoenix pet");
phoenixPet = true;
}
gold += goldDrop;
exp += 100;
lvlsystem();
}else if(hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();
}else if(hp <= 0 && m_hp <= 0){
fight = false;
System.out.println("\nYou died!");
System.out.println("Lost some gold.");
gold *= 0.5;
hp = hpMax;
home();
}
}
}

Ill play it, and take a look at the code while playing it, might get to fix some bugs to Big Grin

Best Regards
~Henning B.
Married to Dsun.
[Image: Resubmit.png]
Need Help?

top
find
quote
dsun
Super Moderators
  • Posts:1,006
  • Joined:Mar 2013
  • Reputation:30
03-19-2013 09:06 PM RE: DragonWorld
Post: #8
awesome man Smile

top
www find
quote
Rarity


  • Posts:9
  • Joined:Mar 2013
  • Reputation:2
03-19-2013 10:58 PM RE: DragonWorld
Post: #9
Yeah, I don't understand Java. I got the logic though Smile

top
find
quote
Doyoy
Black Dragon Member

  • Posts:1,623
  • Joined:Mar 2013
  • Reputation:14
08-23-2013 11:25 AM RE: DragonWorld
Post: #10
(03-19-2013 10:58 PM)Rarity Wrote:  Yeah, I don't understand Java. I got the logic though Smile

THEN WHY THE HELL ARE YOU A JAVA CODER OMG OMGOMG SOMEONE HELP ME GOD I'M CRYING!

top
find
quote
« Next Oldest | Next Newest »
Pages (3): 1 2 3 Next »
Post Reply


  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Index | Return to Top | Lite (Archive) Mode | RSS Syndication

Powered By MyBB, © 2002-2025 MyBB Group.
Designed by Adrian/Reksio 54ceebe7a40ef32df34f37c2065d4490