Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function renderVisionCone() //draws the walls
- {
- clearScreen();
- DynamicSprite.Create(620, 400);
- DrawingSurface *dungeonWalls = Room.GetDrawingSurfaceForBackground();
- if (playerChar.faceDir==eFaceUp){
- MazeType tile[10];
- tile[0]=GetCell(playerChar.x-2, playerChar.y-2);
- tile[1]=GetCell(playerChar.x-1, playerChar.y-2);
- tile[2]=GetCell(playerChar.x, playerChar.y-2);
- tile[3]=GetCell(playerChar.x+1, playerChar.y-2);
- tile[4]=GetCell(playerChar.x+2, playerChar.y-2);
- tile[5]=GetCell(playerChar.x-1, playerChar.y-1);
- tile[6]=GetCell(playerChar.x, playerChar.y-1);
- tile[7]=GetCell(playerChar.x+1, playerChar.y-1);
- tile[8]=GetCell(playerChar.x-1, playerChar.y);
- tile[9]=GetCell(playerChar.x+1, playerChar.y);
- if (tile[0]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 14);
- }
- if (tile[1]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 10);
- }
- if (tile[3]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 9);
- }
- if (tile[2]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 3);
- }
- if (tile[4]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 13);
- }
- if (tile[5]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 8);
- }
- if (tile[7]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 7);
- }
- if (tile[6]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 2);
- }
- if (tile[8]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 6);
- }
- if (tile[9]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 5);
- }
- }
- if (playerChar.faceDir==eFaceRight){
- MazeType tile1[10];
- tile1[0]=GetCell(playerChar.x+2, playerChar.y-2);
- tile1[1]=GetCell(playerChar.x+2, playerChar.y-1);
- tile1[2]=GetCell(playerChar.x+2, playerChar.y);
- tile1[3]=GetCell(playerChar.x+2, playerChar.y+1);
- tile1[4]=GetCell(playerChar.x+2, playerChar.y+2);
- tile1[5]=GetCell(playerChar.x+1, playerChar.y-1);
- tile1[6]=GetCell(playerChar.x+1, playerChar.y);
- tile1[7]=GetCell(playerChar.x+1, playerChar.y+1);
- tile1[8]=GetCell(playerChar.x, playerChar.y-1);
- tile1[9]=GetCell(playerChar.x, playerChar.y+1);
- if (tile1[0]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 14);
- }
- if (tile1[1]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 10);
- }
- if (tile1[3]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 9);
- }
- if (tile1[2]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 3);
- }
- if (tile1[4]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 13);
- }
- if (tile1[5]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 8);
- }
- if (tile1[7]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 7);
- }
- if (tile1[6]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 2);
- }
- if (tile1[8]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 6);
- }
- if (tile1[9]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 5);
- }
- }
- if (playerChar.faceDir==eFaceDown){
- MazeType tile2[10];
- tile2[0]=GetCell(playerChar.x+2, playerChar.y+2);
- tile2[1]=GetCell(playerChar.x+1, playerChar.y+2);
- tile2[2]=GetCell(playerChar.x, playerChar.y+2);
- tile2[3]=GetCell(playerChar.x-1, playerChar.y+2);
- tile2[4]=GetCell(playerChar.x-2, playerChar.y+2);
- tile2[5]=GetCell(playerChar.x+1, playerChar.y+1);
- tile2[6]=GetCell(playerChar.x, playerChar.y+1);
- tile2[7]=GetCell(playerChar.x-1, playerChar.y+1);
- tile2[8]=GetCell(playerChar.x+1, playerChar.y);
- tile2[9]=GetCell(playerChar.x-1, playerChar.y);
- if (tile2[0]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 14);
- }
- if (tile2[1]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 10);
- }
- if (tile2[3]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 9);
- }
- if (tile2[2]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 3);
- }
- if (tile2[4]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 13);
- }
- if (tile2[5]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 8);
- }
- if (tile2[7]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 7);
- }
- if (tile2[6]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 2);
- }
- if (tile2[8]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 6);
- }
- if (tile2[9]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 5);
- }
- }
- if (playerChar.faceDir==eFaceLeft){
- MazeType tile3[10];
- tile3[0]=GetCell(playerChar.x-2, playerChar.y+2);
- tile3[1]=GetCell(playerChar.x-2, playerChar.y+1);
- tile3[2]=GetCell(playerChar.x-2, playerChar.y);
- tile3[3]=GetCell(playerChar.x-2, playerChar.y-1);
- tile3[4]=GetCell(playerChar.x-2, playerChar.y-2);
- tile3[5]=GetCell(playerChar.x-1, playerChar.y+1);
- tile3[6]=GetCell(playerChar.x-1, playerChar.y);
- tile3[7]=GetCell(playerChar.x-1, playerChar.y-1);
- tile3[8]=GetCell(playerChar.x, playerChar.y+1);
- tile3[9]=GetCell(playerChar.x, playerChar.y-1);
- if (tile3[0]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 14);
- }
- if (tile3[1]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 10);
- }
- if (tile3[3]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 9);
- }
- if (tile3[2]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 3);
- }
- if (tile3[4]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 13);
- }
- if (tile3[5]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 8);
- }
- if (tile3[7]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 7);
- }
- if (tile3[6]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 2);
- }
- if (tile3[8]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 6);
- }
- if (tile3[9]==eMazeWall){
- dungeonWalls.DrawImage(0, 0, 5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment