etabeta1

draw functions

Oct 16th, 2019
72
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void renderEnemy(int x, int y){ //draws sprite of enemy
  2.   TV.set_pixel(x+2, y, WHITE);
  3.   TV.set_pixel(x+8, y, WHITE);
  4.  
  5.   TV.set_pixel(x+3, y+1, WHITE);
  6.   TV.set_pixel(x+7, y+1, WHITE);
  7.  
  8.   TV.set_pixel(x+2, y+2, WHITE);
  9.   TV.set_pixel(x+3, y+2, WHITE);
  10.   TV.set_pixel(x+4, y+2, WHITE);
  11.   TV.set_pixel(x+5, y+2, WHITE);
  12.   TV.set_pixel(x+6, y+2, WHITE);
  13.   TV.set_pixel(x+7, y+2, WHITE);
  14.   TV.set_pixel(x+8, y+2, WHITE);
  15.  
  16.   TV.set_pixel(x+1, y+3, WHITE);
  17.   TV.set_pixel(x+2, y+3, WHITE);
  18.   TV.set_pixel(x+4, y+3, WHITE);
  19.   TV.set_pixel(x+5, y+3, WHITE);
  20.   TV.set_pixel(x+6, y+3, WHITE);
  21.   TV.set_pixel(x+8, y+3, WHITE);
  22.   TV.set_pixel(x+9, y+3, WHITE);
  23.  
  24.   TV.set_pixel(x, y+4, WHITE);
  25.   TV.set_pixel(x+1, y+4, WHITE);
  26.   TV.set_pixel(x+2, y+4, WHITE);
  27.   TV.set_pixel(x+3, y+4, WHITE);
  28.   TV.set_pixel(x+4, y+4, WHITE);
  29.   TV.set_pixel(x+5, y+4, WHITE);
  30.   TV.set_pixel(x+6, y+4, WHITE);
  31.   TV.set_pixel(x+7, y+4, WHITE);
  32.   TV.set_pixel(x+8, y+4, WHITE);
  33.   TV.set_pixel(x+9, y+4, WHITE);
  34.   TV.set_pixel(x+10, y+4, WHITE);
  35.  
  36.   TV.set_pixel(x, y+5, WHITE);
  37.   TV.set_pixel(x+2, y+5, WHITE);
  38.   TV.set_pixel(x+3, y+5, WHITE);
  39.   TV.set_pixel(x+4, y+5, WHITE);
  40.   TV.set_pixel(x+5, y+5, WHITE);
  41.   TV.set_pixel(x+6, y+5, WHITE);
  42.   TV.set_pixel(x+7, y+5, WHITE);
  43.   TV.set_pixel(x+8, y+5, WHITE);
  44.   TV.set_pixel(x+10, y+5, WHITE);
  45.  
  46.   TV.set_pixel(x, y+6, WHITE);
  47.   TV.set_pixel(x+2, y+6, WHITE);
  48.   TV.set_pixel(x+8, y+6, WHITE);
  49.   TV.set_pixel(x+10, y+6, WHITE);
  50.  
  51.   TV.set_pixel(x+3, y+7, WHITE);
  52.   TV.set_pixel(x+4, y+7, WHITE);
  53.   TV.set_pixel(x+6, y+7, WHITE);
  54.   TV.set_pixel(x+7, y+7, WHITE);
  55. }
  56.  
  57.  
  58. void renderPlayer(int x, int y){  //draws player sprite
  59.   TV.set_pixel(x+2, y, WHITE);
  60.   TV.set_pixel(x+5, y, WHITE);
  61.  
  62.   TV.set_pixel(x+2, y+1, WHITE);
  63.   TV.set_pixel(x+5, y+1, WHITE);
  64.  
  65.   TV.set_pixel(x+1, y+2, WHITE);
  66.   TV.set_pixel(x+2, y+2, WHITE);
  67.   TV.set_pixel(x+5, y+2, WHITE);
  68.   TV.set_pixel(x+6, y+2, WHITE);
  69.  
  70.   TV.set_pixel(x+1, y+3, WHITE);
  71.   TV.set_pixel(x+2, y+3, WHITE);
  72.   TV.set_pixel(x+3, y+3, WHITE);
  73.   TV.set_pixel(x+4, y+3, WHITE);
  74.   TV.set_pixel(x+5, y+3, WHITE);
  75.   TV.set_pixel(x+6, y+3, WHITE);
  76.  
  77.   TV.set_pixel(x, y+4, WHITE);
  78.   TV.set_pixel(x+1, y+4, WHITE);
  79.   TV.set_pixel(x+2, y+4, WHITE);
  80.   TV.set_pixel(x+5, y+4, WHITE);
  81.   TV.set_pixel(x+6, y+4, WHITE);
  82.   TV.set_pixel(x+7, y+4, WHITE);
  83.  
  84.   TV.set_pixel(x, y+5, WHITE);
  85.   TV.set_pixel(x+2, y+5, WHITE);
  86.   TV.set_pixel(x+3, y+5, WHITE);
  87.   TV.set_pixel(x+4, y+5, WHITE);
  88.   TV.set_pixel(x+5, y+5, WHITE);
  89.   TV.set_pixel(x+7, y+5, WHITE);
  90.  
  91.   TV.set_pixel(x, y+6, WHITE);
  92.   TV.set_pixel(x+1, y+6, WHITE);
  93.   TV.set_pixel(x+2, y+6, WHITE);
  94.   TV.set_pixel(x+5, y+6, WHITE);
  95.   TV.set_pixel(x+6, y+6, WHITE);
  96.   TV.set_pixel(x+7, y+6, WHITE);
  97.  
  98.   TV.set_pixel(x+2, y+7, WHITE);
  99.   TV.set_pixel(x+3, y+7, WHITE);
  100.   TV.set_pixel(x+4, y+7, WHITE);
  101.   TV.set_pixel(x+5, y+7, WHITE);
  102.  
  103.   TV.set_pixel(x+1, y+8, WHITE);
  104.   TV.set_pixel(x+2, y+8, WHITE);
  105.   TV.set_pixel(x+5, y+8, WHITE);
  106.   TV.set_pixel(x+6, y+8, WHITE);
  107. }
RAW Paste Data