My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
strategy  
Updated Dec 20, 2007 by akshay.d...@gmail.com

Strategy

Aakraman let's you specify your strategy as ruby code. It works letting you decide what happens during each execution of your "play" method. The game let's you perform some basic actions which are the building blocks for your strategy. Here are some examples:

2.times do
  create_farmer
  farm
end

OR Something more advanced like

if my_resources < 1000
  2.times do
    create_farmer
    farm
  end
else
  create_warrior unless my_warriors > 100
end

attack 'xyz'

You can create new instance methods, which you can use later...

def build_economy
  (my_resources/5).times do
     create_farmer
  end
  8.times do
     farm 
  end
end

def build_military_and_economy
  if my_resouces < 40000
     build_economy
  else
     10.times do
        create_warrior unless my_warriors > 150
     end
  end
end

build_military_and_economy
Comment by rangana...@gmail.com, Jan 25, 2008

its excellent!


Sign in to add a comment
Powered by Google Project Hosting