<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,6 +20,36 @@ XGame('The Panda',[640,480]) { |screen, world, listeners|
 		end
 	end
 
+	class Star &lt; Rubygame::Sprites::ImageSprite
+		attr_accessor :above
+		attr_accessor :below
+		attr_accessor :toleft
+		attr_accessor :toright
+		attr_accessor :owner
+	end
+
+	def check_stars(astar, world)
+		world.each do |star|
+			next if star == astar
+			next if star.owner == astar.owner
+			if astar.collide_sprite?star
+				astar.kill
+				break
+			end
+			# Vertically alined
+			if (star.rect.x - astar.rect.x).abs &lt; 15
+				star.above = true if star.rect.y &gt; astar.rect.y # astar is above star
+				star.below = true if star.rect.y &lt; astar.rect.y # astar is below star
+			end
+			# Horiontally alined
+			if (star.rect.x - astar.rect.y).abs &lt; 15
+				star.toright = true if star.rect.x &gt; astar.rect.x # astar is to right of star
+				star.toleft = true if star.rect.x &lt; astar.rect.x # astar is left of star
+			end
+			star.kill if (star.above &amp;&amp; star.below) || (star.toleft &amp;&amp; star.toright)
+		end
+	end
+
 	players = Players.new(2)
 	puts &quot;Player ##{players.player}'s turn.&quot;
 
@@ -34,12 +64,15 @@ XGame('The Panda',[640,480]) { |screen, world, listeners|
 
 	listeners.addEventListener(Rubygame::MouseDownEvent) { |event|
 		if event.button == 1
-			star = Rubygame::Sprites::ImageSprite.new(event.pos[0], event.pos[1], &quot;star#{players.player}.png&quot;)
+			star = Star.new(event.pos[0]-16, event.pos[1]-16, &quot;star#{players.player}.png&quot;)
+			star.owner = players.player
 			world.push star
+			check_stars star, world
+
+			sleep 0.2 # Keep player from accidentally going twice
 			players.succ
+			puts &quot;Player ##{players.player}'s turn.&quot;
 		end
-		sleep 0.2 # Keep player from accidentally going twice
-		puts &quot;Player ##{players.player}'s turn.&quot;
 	}
 
 }</diff>
      <filename>examples/stars</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e2bd53230aa7a6504000b76b3fb22e24a38584bf</id>
    </parent>
  </parents>
  <author>
    <name>Stephen Paul Weber</name>
    <email>singpolyma@singpolyma.net</email>
  </author>
  <url>http://github.com/singpolyma/xgame/commit/1ada6aa81f38988b83ca08c023f9dad610b847a0</url>
  <id>1ada6aa81f38988b83ca08c023f9dad610b847a0</id>
  <committed-date>2008-12-24T15:28:58-08:00</committed-date>
  <authored-date>2008-12-24T15:28:58-08:00</authored-date>
  <message>Add basic rule checking logic</message>
  <tree>3856fcde8559346e7142e89fe0d66b566e276257</tree>
  <committer>
    <name>Stephen Paul Weber</name>
    <email>singpolyma@singpolyma.net</email>
  </committer>
</commit>
