Skip to content

Instantly share code, notes, and snippets.

@shawn42
Created July 11, 2009 22:03
Show Gist options
  • Save shawn42/145402 to your computer and use it in GitHub Desktop.
Save shawn42/145402 to your computer and use it in GitHub Desktop.
def create_taxi_parts(direction)
taxi_parts = {
TaxiHood => 'taxi_hood',
TaxiBlower => 'taxi_blower',
TaxiMidsection => 'taxi_midsection',
TaxiTail => 'taxi_tail',
TaxiRearsection => 'taxi_rearsection',
TaxiThruster => 'taxi_thruster',
TaxiRightThruster => 'taxi_right_thruster',
TaxiRearThruster => 'taxi_rear_thruster'
}
@parts = []
taxi_parts.each do |part_class,part| part = create_actor part.to_s, :x => part_class.offset_x(direction) + @taxi.x, :y => part_class.offset_y(direction) + @taxi.y
part.action = direction
part.when :remove_me do
fire :restart_level
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment