Advertisement
Guest User

Untitled

a guest
Aug 4th, 2013
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. for (var ray:int=0; ray<60; ray++) {
  2. for (var dis:int=0; dis<8+light; dis++) {
  3. // light-variable only applies an additional effect, ignore it.
  4.  
  5. var xt:int=Math.round((H.x-15)/30)+Math.cos((ray*6)*(Math.PI/180))*dis;
  6. var yt:int=Math.round((H.y)/30)+Math.sin((ray*6)*(Math.PI/180))*dis;
  7.  
  8. if ( target tile is within bounds ) {
  9.  
  10. apply shading on target tile
  11.  
  12. if ( target tile is solid ) {
  13. break;
  14. }
  15.  
  16. }
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement