Prev: ActiveSupport's New Approach to Core Extensions! [was: Facets 2.8.3 released]
Next: Method call within a class
From: Garret Dupont on 11 Apr 2010 10:45 I am attempting to create a gladitorial fighting sim. It will be able to pit two players (computer controlled) and based on stats, weapons, armor and some randomness will attack, deal damage, dodge and counter attack. What would be the easiest way to go about doing this. The outcome will be in a play-by-play format, printed on screen and also saved as a text document. The players stats will be saved and would earn experience based on the difficulty of the battle. I appreciate any response. Very Respectfully, Wiz -- Posted via http://www.ruby-forum.com/.
From: Pier-Luc Caron St-Pierre on 11 Apr 2010 12:39 Take a look at Ryan Bates's Ruby Warrior? http://github.com/ryanb/ruby-warrior On Sun, Apr 11, 2010 at 10:45, Garret Dupont <wizardofozz(a)gmail.com> wrote: > I am attempting to create a gladitorial fighting sim. It will be able to > pit two players (computer controlled) and based on stats, weapons, armor > and some randomness will attack, deal damage, dodge and counter attack. > What would be the easiest way to go about doing this. The outcome will > be in a play-by-play format, printed on screen and also saved as a text > document. The players stats will be saved and would earn experience > based on the difficulty of the battle. I appreciate any response. > > Very Respectfully, > Wiz > -- > Posted via http://www.ruby-forum.com/. > > -- Cordialement, Pier-Luc
From: Garret Dupont on 11 Apr 2010 12:43 Pier-Luc Caron St-Pierre wrote: > Take a look at Ryan Bates's Ruby Warrior? > > http://github.com/ryanb/ruby-warrior Yeah ive taken a look at that. Not really what im looking for though, this is more of a simulation, you tell the computer to use these two gladiators and then it does the simulation on its own, figuring out the outcome with some randomness added with the skills of the fighter. Then prints out a play by play to the screen and file name. The play by play lines would come from the program or a seperate text file based on how well the attack or dodge was executed. -- Posted via http://www.ruby-forum.com/.
From: H- 16 on 11 Apr 2010 18:34 Garret Dupont wrote: > I am attempting to create a gladitorial fighting sim. It will be able to > pit two players (computer controlled) and based on stats, weapons, armor > and some randomness will attack, deal damage, dodge and counter attack. > What would be the easiest way to go about doing this. The outcome will > be in a play-by-play format, printed on screen and also saved as a text > document. The players stats will be saved and would earn experience > based on the difficulty of the battle. I appreciate any response. > > Very Respectfully, > Wiz You'll want to use .rand for a certain number and add it as an attack modifyer... basically adding it in, then subtracting it when you don't need it. Or just use a variable for base stats. Printing on screen is easy,though if it's like R-warriorwith it's showing positions on screen you'll want to use print and \n for a new line. Though for a text doc, you might want to use a Yaml doc and just read it with notepad or WordPad. -- Posted via http://www.ruby-forum.com/.
From: Aldric Giacomoni on 12 Apr 2010 08:43
Garret Dupont wrote: > I am attempting to create a gladitorial fighting sim. It will be able to > pit two players (computer controlled) and based on stats, weapons, armor > and some randomness will attack, deal damage, dodge and counter attack. > What would be the easiest way to go about doing this. The outcome will > be in a play-by-play format, printed on screen and also saved as a text > document. The players stats will be saved and would earn experience > based on the difficulty of the battle. I appreciate any response. > > Very Respectfully, > Wiz Sounds like you should take a look at the seventh Ruby Programming Challenge For Newbies: http://rubylearning.com/blog/2010/02/23/rpcfn-broadsides-7/ The submitted server and winning codes may help you. -- Posted via http://www.ruby-forum.com/. |