Advertisement
CaptainLepidus

objControl

Apr 25th, 2012
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Information about object: objControl
  2. Sprite:
  3. Solid: false
  4. Visible: true
  5. Depth: 0
  6. Persistent: false
  7. Parent:
  8. Mask:
  9.  
  10. Create Event:
  11.  
  12. execute code:
  13. {
  14.     var i,j;
  15.     w = 16;
  16.     h = 16;
  17.     d = 16;
  18.     for(i=0;i<w;i=i+1)
  19.     for(j=0;j<h;j=j+1)
  20.     {
  21.         zz[ i , j ] = i + j * h;
  22.     }
  23.     for(k=0;k<d;k=k+1)
  24.     {
  25.         for(i=0;i<w;i=i+1)
  26.         for(j=0;j<h;j=j+1)
  27.         {
  28.             blo[ zz[ i , j ] , k ] = 1;
  29.             hei[ i , j ] = 0;
  30.         }
  31.     }
  32.     d3d_start();
  33. }
  34. Draw Event:
  35.  
  36. execute code:
  37.  
  38. {
  39.     d3d_set_projection( 128 , 128 , 300 , 128 , 128 , 290 , 0 , 0 , 1 );
  40.     tex = background_get_texture( texGrass );
  41.     for(k=0;k<d;k=k+1)
  42.     {
  43.         for(i=0;i<w;i=i+1)
  44.         for(j=0;j<h;j=j+1)
  45.         {
  46.             if blo[ zz[ i , j ] , k ] == 1
  47.             {
  48.                 d3d_draw_block( i * 16 , j * 16 , k * 16 , i * 16 + 16 , j * 16 + 16 , k * 16 + 16 , tex , 1 , 1 );
  49.             }
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement