Class: BMPMap
- Inherits:
-
Object
- Object
- BMPMap
- Defined in:
- lib/ruby-doom.rb
Instance Attribute Summary collapse
-
#scale_factor ⇒ Object
Returns the value of attribute scale_factor.
-
#thinning_factor ⇒ Object
Returns the value of attribute thinning_factor.
Instance Method Summary collapse
- #add_commando(p) ⇒ Object
- #add_imp(p) ⇒ Object
- #add_sergeant(p) ⇒ Object
- #add_shotgun(p) ⇒ Object
- #create_wad(filename) ⇒ Object
-
#initialize(file) ⇒ BMPMap
constructor
A new instance of BMPMap.
- #set_player(p) ⇒ Object
Constructor Details
Instance Attribute Details
#scale_factor ⇒ Object
Returns the value of attribute scale_factor.
756 757 758 |
# File 'lib/ruby-doom.rb', line 756 def scale_factor @scale_factor end |
#thinning_factor ⇒ Object
Returns the value of attribute thinning_factor.
756 757 758 |
# File 'lib/ruby-doom.rb', line 756 def thinning_factor @thinning_factor end |
Instance Method Details
#add_commando(p) ⇒ Object
769 770 771 |
# File 'lib/ruby-doom.rb', line 769 def add_commando(p) @things.add_commando p end |
#add_imp(p) ⇒ Object
772 773 774 |
# File 'lib/ruby-doom.rb', line 772 def add_imp(p) @things.add_imp p end |
#add_sergeant(p) ⇒ Object
766 767 768 |
# File 'lib/ruby-doom.rb', line 766 def add_sergeant(p) @things.add_sergeant p end |
#add_shotgun(p) ⇒ Object
775 776 777 |
# File 'lib/ruby-doom.rb', line 775 def add_shotgun(p) @things.add_shotgun p end |
#create_wad(filename) ⇒ Object
778 779 780 781 782 783 784 785 786 787 788 |
# File 'lib/ruby-doom.rb', line 778 def create_wad(filename) b = BMPDecoder.new(@bitmap_file) b.scale_factor = @scale_factor b.thinning_factor = @thinning_factor w = Wad.new w.lumps << UndecodedLump.new("MAP01") w.lumps << @things pc = PathCompiler.new(PointsPath.new(b.thin)) w.lumps.concat(pc.lumps) w.write(filename) end |
#set_player(p) ⇒ Object
763 764 765 |
# File 'lib/ruby-doom.rb', line 763 def set_player(p) @things.add_player p end |