public TestScreen(Game1 game, double x = 0, double y = 0) : base(game, x, y) { info = new TextObject(game, this, game.DebugFont, Color.White, 100, 100); button = new Button(game, this, 1000, 100, 200, 100); player = new Player(game, this, 0, 0, 100, 100); test = new testObject(game, this, 0, 0, 100, 100); AllObjects.Add(new RigidBody(game, this, Assets.getColorTexture(game, Color.Yellow), 200, 0, 100, 100)); AllObjects.Add(new Block(game, this, 0, 1000, 1920, 50)); AllObjects.Add(new Block(game, this, 0, 0, 1920, 50)); AllObjects.Add(new Block(game, this, 900, 600, 400, 400)); AllObjects.Add(new Slope(game, this, 1, 300, 600, 600, 400)); AllObjects.Add(new Slope(game, this, -1, 1300, 600, 400, 400)); AllObjects.Add(new Block(game, this, 2000, 800, 300, 50)); AllObjects.Add(new Floor(game, this, 2000, 600, 300, 5)); AllObjects.Add(new enemy(game, this, 1920, 600, 80, 90)); AllObjects.Add(new Block(game, this, 2500, 1000, 1920, 50)); AllObjects.Add(new Block(game, this, 0, 800, 200, 200)); int i = 0; foreach (GameObject o in AllObjects) { if (o is enemy) { ((enemy)o).id = i; } i++; } }
public Block(Game1 game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.getColorTexture(game, Color.White), x, y, width, height) { }
public Floor(Game1 game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.getColorTexture(game, Color.Yellow), x, y, width, height) { }
public void onLeave(object sender, UiEventArgs e) { Texture = Assets.getColorTexture(game, Color.Blue); }
public void onHover(object sender, UiEventArgs e) { Texture = Assets.getColorTexture(game, Color.Yellow); }
public Button(MonoGameLibrary.Game game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.getColorTexture(game, Color.Blue), x, y, width, height) { OnHover += onHover; OnLeave += onLeave; OnDown += onClick; a = new MoveAnimator(game, this, 1, 1, new Point(0, 0), new Point(100, 100), new Point(1000, 400), new Point(1000, 500)); Animators.Add(a); }