Skip to content
Browse files

make sure the build passes and things still work

  • Loading branch information...
1 parent b4c977c commit 77fe8ee198dad922b4b18e2d8b8699ca6dba155d @bgoodspeed committed
View
36 lib/factories/game_internals_factory.rb
@@ -171,27 +171,35 @@ def interaction_pallette_160
pal
end
+ def walkable
+ Walkable.new
+ end
+ def blocking
+ Blocking.new
+ end
+
def pallette
pal = SurfaceBackedPallette.new("scaled-background-20x20.png", 20, 20)
- pal['G'] = SBPEntry.new([1,4], false)
- pal['M'] = SBPEntry.new([0,2], true)
- pal['g'] = SBPEntry.new([0,6], false)
- pal['O'] = SBPEntry.new([1,3], true) #TODO this should not be open treasure
- pal['T'] = SBPEntry.new([1,3], true) #TODO this should not be treasure
- pal['w'] = SBPEntry.new([0,5], false) #TODO this should not be warp
- pal['W'] = SBPEntry.new([0,5], false) #TODO this should not be warp
+
+ pal['G'] = SBPEntry.new([1,4], walkable)
+ pal['M'] = SBPEntry.new([0,2], blocking)
+ pal['g'] = SBPEntry.new([0,6], walkable)
+ pal['O'] = SBPEntry.new([1,3], blocking) #TODO this should not be open treasure
+ pal['T'] = SBPEntry.new([1,3], blocking) #TODO this should not be treasure
+ pal['w'] = SBPEntry.new([0,5], walkable) #TODO this should not be warp
+ pal['W'] = SBPEntry.new([0,5], walkable) #TODO this should not be warp
pal
end
def pallette_160
pal = Pallette.new(tile(:blue))
- pal['O'] = JsonLoadableSurface.new("open-treasure-on-grass-bg-160.png", true)
- pal['T'] = JsonLoadableSurface.new("treasure-on-grass-bg-160.png", true)
- pal['w'] = JsonLoadableSurface.new("water-bg-160.png", true)
- pal['W'] = JsonLoadableSurface.new("town-on-grass-bg-160.png", false)
- pal['M'] = JsonLoadableSurface.new("mountain-bg-160.png", true)
- pal['G'] = JsonLoadableSurface.new("grass-bg-160.png", false)
- pal['g'] = JsonLoadableSurface.new("real-grass-bg-160.png", false)
+ pal['O'] = JsonLoadableSurface.new("open-treasure-on-grass-bg-160.png", blocking)
+ pal['T'] = JsonLoadableSurface.new("treasure-on-grass-bg-160.png", blocking)
+ pal['w'] = JsonLoadableSurface.new("water-bg-160.png", blocking)
+ pal['W'] = JsonLoadableSurface.new("town-on-grass-bg-160.png", walkable)
+ pal['M'] = JsonLoadableSurface.new("mountain-bg-160.png", blocking)
+ pal['G'] = JsonLoadableSurface.new("grass-bg-160.png", walkable)
+ pal['g'] = JsonLoadableSurface.new("real-grass-bg-160.png", walkable)
pal
end
View
2 lib/game_requirements.rb
@@ -31,6 +31,8 @@
require 'lib/helpers/animation_helper'
require 'lib/helpers/animated_sprite_helper'
+require 'lib/tile_system/blocking'
+require 'lib/tile_system/walkable'
require 'lib/tile_system/json_surface'
require 'lib/tile_system/json_loadable_surface'
require 'lib/tile_system/coordinate_helper'
View
8 lib/tile_system/blocking.rb
@@ -0,0 +1,8 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+class Blocking
+ def is_blocking?
+ true
+ end
+end
View
8 lib/tile_system/walkable.rb
@@ -0,0 +1,8 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+class Walkable
+ def is_blocking?
+ false
+ end
+end
View
12 spec/tile_system/blocking_spec.rb
@@ -0,0 +1,12 @@
+
+require 'spec/rspec_helper'
+
+describe Blocking do
+ before(:each) do
+ @blocking = Blocking.new
+ end
+
+ it "should block" do
+ @blocking.is_blocking?.should be_true
+ end
+end
View
12 spec/tile_system/walkable_spec.rb
@@ -0,0 +1,12 @@
+
+require 'spec/rspec_helper'
+
+describe Walkable do
+ before(:each) do
+ @walkable = Walkable.new
+ end
+
+ it "should not block" do
+ @walkable.is_blocking?.should be_false
+ end
+end

0 comments on commit 77fe8ee

Please sign in to comment.
Something went wrong with that request. Please try again.