Esempio n. 1
0
 public GameObjectShape(MyShape model)
 {
     this.Model = model;
     if(model is PlayerModel || model is EnemyModel || model is PowerUPModel)
     {
         this.shap = new Rectangle();
         (shap as Shape).Fill = model.B;
         shap.DataContext = model;
         shap.SetBinding(Rectangle.WidthProperty, new Binding("Area.Width"));
         shap.SetBinding(Rectangle.HeightProperty, new Binding("Area.Height"));
     }
     else if(model is EnemyBulletModel || model is PlayerBulletModel)
     {
         this.shap = new Ellipse();
         (shap as Shape).Fill = model.B;
         shap.DataContext = model;
         shap.SetBinding(Ellipse.WidthProperty, new Binding("Area.Width"));
         shap.SetBinding(Ellipse.HeightProperty, new Binding("Area.Height"));
     }
 }
Esempio n. 2
0
 //csak olyan elemeknek amik nem vesznek reszt a jatekban(sidepanle+label)
 public GameObjectShape(MyShape model, FrameworkElement elem)
 {
     this.shap = elem;
     this.model = model;
 }
Esempio n. 3
0
 public EnemyBulletBl(MyShape model, double xdir, double ydir)
 {
     this.shape = model;
     this.xdir = xdir;
     this.ydir = ydir;
 }