View Single Post
  #1  
Old 07-16-2011, 02:26 PM
iBeatz iBeatz is offline
Kavan
iBeatz's Avatar
Join Date: Dec 2010
Location: Northern Ireland, UK
Posts: 154
iBeatz will become famous soon enough
Send a message via Yahoo to iBeatz
Checking for polygon wall

I've been having an issue trying to do this for a while now, and I thought I'd ask here for a hand.
Okay, so I have these 7 variables:

PHP Code:
 this.game_height_b = (GraalControl.height/2)+150
 
this.char_top_x = (GraalControl.width/2);
 
this.char_top_y this.game_height_b 12;
 
this.char_left_x = (GraalControl.width/2)-12;
 
this.char_left_y this.game_height_b 2;
 
this.char_right_x = (GraalControl.width/2)+12;
 
this.char_right_y this.game_height_b 2
These control a moveable character, all except this.game_height_b.
Now, I also have a wall of small polygons all down the left side of my screen, each polygon with 4 coordinates, so it's basically a small wall of rectangles of different lengths.
What I would like to do is take each this.char x variable and try to see if it is less than the innermost polygon's x coordinate on each char's y coordinate.

(NOTE: These polygons are continually moving down the left side of my screen, so I have little way of knowing the index of each polygon as it is always changing.)
Any suggestions?
__________________

Intelligence without ambition is like a bird without wings.

Reply With Quote