Advertisement
Guest User

Osztály

a guest
Oct 6th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Drawing;
  6.  
  7. namespace Street_Race_Easy2D
  8. {
  9.     public class Level : GameWindow
  10.     {
  11.         private Graphics DrawHandle;
  12.         private string Location = @"Data//GFX//bg.png";
  13.         public static int imagex = 0;
  14.         public static int imagey = 0;
  15.  
  16.         public Level(Graphics g)
  17.         {
  18.             DrawHandle = g;
  19.         }        
  20.  
  21.         public void init()
  22.         {
  23.             Render();
  24.         }
  25.  
  26.         private void Render()
  27.         {          
  28.             Image image = new Bitmap(Location);
  29.             //------------------------------------------------------------------
  30.             DrawHandle.DrawImage(image, imagex, imagey - 120);
  31.             DrawHandle.DrawImage(image, imagex, imagey + 360);
  32.             DrawHandle.DrawImage(image, imagex, imagey + 240);
  33.             DrawHandle.DrawImage(image, imagex, imagey + 120);
  34.             DrawHandle.DrawImage(image, imagex, imagey);
  35.             //------------------------------------------------------------------
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement