Beispiel #1
0
        public Enemy()
            : base(new Cog.Vector2(32f, 32f))
        {
            timeSinceJump = Engine.RandomFloat() * -.1f;

            sc        = SpriteComponent.RegisterOn(this, Program.Pixel);
            sc.Origin = Vector2.One / 2f;
            sc.Color  = Program.Foreground;
        }
Beispiel #2
0
        public Snapshot()
        {
            Size           = new Cog.Vector2(256f, 96f);
            Sprite         = SpriteComponent.RegisterOn(this, Program.Pixel);
            Sprite.Origin  = new Vector2(0f, 0f);
            Sprite.Color   = Program.Foreground;
            Sprite.Color.A = 0;
            Sprite.Scale   = Size;

            RegisterEvent <UpdateEvent>(0, Update);
        }
Beispiel #3
0
        public LevelEnd()
            : base(32)
        {
            Texture = Program.Pixel;

            RegisterEvent <PhysicsUpdateEvent>(0, PhysicsUpdate);
            var back = SpriteComponent.RegisterOn(this, Program.Portal);

            back.Color = Program.Foreground;
            back.Scale = new Vector2(1.1f, 1.1f);
            SpriteComponent.RegisterOn(this, Program.Portal);
        }
Beispiel #4
0
        public Player()
            : base(new Cog.Vector2(24f, 64f))
        {
            texture       = Program.Player;
            sprite        = SpriteComponent.RegisterOn(this, texture);
            sprite.Origin = new Vector2(textureSize.X / 2f, textureSize.Y / 2f);
            sprite.Color  = Program.Foreground;

            RegisterEvent <KeyDownEvent>((int)Keyboard.Key.R, 0, Restart);

            Depth = -1;
        }