4 Replies - 6927 Views - Last Post: 11 March 2009 - 02:23 PM Rate Topic: -----

#1 IceCastle   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-January 09

Text Adventure

Posted 19 January 2009 - 11:12 PM

Hi. I have recently been trying to learn ruby, and I have made a few simple programs. My main reason for learning Ruby is mostly just for fun, and I'm also interested in making games. I thought a good place to start might be to try making a simple text adventure. I couldn't really find anything useful on the internet, and I don't know where to start, so any help with getting started would be greatly appreciated. Since I want to add RPG elements I also want to include a variable for lighting for first strikes.

Is This A Good Question/Topic? 0
  • +

Replies To: Text Adventure

#2 IceCastle   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-January 09

Re: Text Adventure

Posted 22 January 2009 - 05:44 AM

I started the text adventure with a script I found on the internet that I'm using for now, since I couldn't make my own. Now I need to know how to name my charters with "gets", and make a 'party', and 'reserve' system. I'm not sure how far I'll get when I get to the even more complicated things, but I'd still like to try. I tried a few things for the naming, like:
def
if party < 3
party[] = gets.chomp
puts 'added new party member'
else if reserve < 3
reserve[] = gets.chomp
puts 'added new reserve member'
else
puts 'Your party, and reserve is full'
end


but once they're in a 'party' array, I don't know how to initialize them.
I also don't know how to implement a light variable. ex.
area_light.to_i += player_light_source.to_i

if area_light.to_i < leader_eyesight/reflexes.to_i  -= randomly_generated_number
enemy_first_strike


Was This Post Helpful? 0
  • +
  • -

#3 eflix   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 22-January 09

Re: Text Adventure

Posted 28 January 2009 - 05:01 AM

View PostIceCastle, on 22 Jan, 2009 - 04:44 AM, said:

I started the text adventure with a script I found on the internet that I'm using for now, since I couldn't make my own. Now I need to know how to name my charters with "gets", and make a 'party', and 'reserve' system. I'm not sure how far I'll get when I get to the even more complicated things, but I'd still like to try. I tried a few things for the naming, like:
def
if party < 3
party[] = gets.chomp
puts 'added new party member'
else if reserve < 3
reserve[] = gets.chomp
puts 'added new reserve member'
else
puts 'Your party, and reserve is full'
end


but once they're in a 'party' array, I don't know how to initialize them.
I also don't know how to implement a light variable. ex.
area_light.to_i += player_light_source.to_i

if area_light.to_i < leader_eyesight/reflexes.to_i  -= randomly_generated_number
enemy_first_strike



Sounds like an interesting project! Perhaps it may be easier to implement if you think those entities you mentioned (party, character, reserve, etc.) as objects, and their names, strength and so on as attributes.
You may want to check this online book because there's a little text adventure game in their pages that you can get some ideas from.
Good luck!
Was This Post Helpful? 1
  • +
  • -

#4 IceCastle   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-January 09

Re: Text Adventure

Posted 07 February 2009 - 05:12 PM

Okay, I'll look through it then.

Thanks for the reply.
Was This Post Helpful? 0
  • +
  • -

#5 Huw   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 3
  • Joined: 19-November 06

Re: Text Adventure

Posted 11 March 2009 - 02:23 PM

Here are links to a tutorial I wrote about creating text adventures in Ruby:

http://www.bitwisema...entures-In-Ruby
http://www.bitwisema...-In-Ruby-Part-2
http://www.bitwisema...-In-Ruby-Part-3

You will also find some relevant info and tips (on data structures etc.) in The Book Of Ruby, which is a free eBook in 20 chapters which I also wrote:

http://www.sapphires...he-Book-Of-Ruby

best wishes
Huw
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1