Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (var ray:int=0; ray<60; ray++) {
- for (var dis:int=0; dis<8+light; dis++) {
- // light-variable only applies an additional effect, ignore it.
- var xt:int=Math.round((H.x-15)/30)+Math.cos((ray*6)*(Math.PI/180))*dis;
- var yt:int=Math.round((H.y)/30)+Math.sin((ray*6)*(Math.PI/180))*dis;
- if ( target tile is within bounds ) {
- apply shading on target tile
- if ( target tile is solid ) {
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement