Exemple #1
0
        private int[] mA; //input key array. 0 = left, 1 = up, 2 = right

        public Player(DynamicShape shape, IBaseImage image) : base(shape, image)
        {
            mA = new int[3];
            taxiOrientation = TaxiOrientation.Left;
            taxiDirection   = TaxiDirection.None;
            imageContainer  = ImageContainer.GetInstance();
            Shape           = new DynamicShape(
                new Vec2F(),
                new Vec2F(Constants.EXTENT_X * 2, Constants.EXTENT_Y));
            Image = imageContainer.GetPlayerStride(taxiOrientation, taxiDirection);
            SpaceTaxiBus.GetBus().Subscribe(GameEventType.PlayerEvent, this);
        }
Exemple #2
0
 public void InitializeGameState()
 {
     eventBus       = SpaceTaxiBus.GetBus();
     imageContainer = ImageContainer.GetInstance();
     backgroundImg  = new Entity(new StationaryShape(0, 0, 1, 1),
                                 imageContainer.GetImageByName("SpaceBackground.png"));
     pausedText = new Text(
         "Game paused. \n\nPress P to continue \nPress ESC to quit",
         new Vec2F(0.23f, 0.1f),
         new Vec2F(0.6f, 0.6f));
     pausedText.SetColor(Color.White);
     pausedText.SetFontSize(40);
 }
Exemple #3
0
 public void InitializeGameState()
 {
     spaceTaxiBus    = SpaceTaxiBus.GetBus();
     imageContainer  = ImageContainer.GetInstance();
     backgroundImage =
         new Entity(
             new StationaryShape(0.0f, 0.0f, 1f, 1f),
             imageContainer.GetImageByName("SpaceBackground.png"));
     gameOverText = new Text("GAME OVER", new Vec2F(0.31f, 0.4f), new Vec2F(0.4f, 0.3f));
     gameOverText.SetColor(Color.White);
     tryAgainButton =
         new Text("Press ENTER to try again", new Vec2F(0.25f, 0.0f), new Vec2F(0.7f, 0.5f));
     tryAgainButton.SetColor(Color.White);
     tryAgainButton.SetFontSize(20);
 }
 public void Init()
 {
     win            = new Window("ImageContainerTest", 200, AspectRatio.R1X1);
     imageContainer = ImageContainer.GetInstance();
 }
Exemple #5
0
 public Customer(Shape shape, IBaseImage image) : base(shape, image)
 {
     Shape.AsDynamicShape().Direction = new Vec2F();
     imageContainer = ImageContainer.GetInstance();
     direction      = CustomerDirection.Right;
 }