Permalink
Browse files

began adding attributes to Enemy and Tower classes

  • Loading branch information...
1 parent 94c5bca commit 7b5d252976fbfecbc9e5ff3d6e54e31f7b95c1df @jackRogers jackRogers committed Apr 17, 2012
Showing with 17 additions and 2 deletions.
  1. +17 −2 DD.rb
View
19 DD.rb
@@ -2,21 +2,36 @@
#class for enemy units
class Enemy
- def initialize(startPosition, sprite, hp)
+ attr_accessor :position, :sprite, :hp
+
+ def initialize(startPosition, sprite, startingHealth)
+ @position = startPosition
+ @sprite = sprite
+ @hp = startingHealth
+
+
end
end
#class for friendly towers
class Tower
+ attr_accessor :position, :sprite, :range, :damage, :cooldown
+
def initialize(position,sprite,range,damage,cooldown)
+ @position = position
+ @sprite = sprite
+ @range = range
+ @damage = damage
+ @cooldown = cooldown
+
end
end
-#class for game mapgi
+#class for game mapping
class GameMap
def initialize(MapFile)

0 comments on commit 7b5d252

Please sign in to comment.