Exemple #1
0
 public RigidBlock(GameScreen screen, Vector2 pos, float width, float height, float rotation = 1)
     : base(screen, width, height)
 {
     Position = pos;
     PhysicsBody.Body.Rotation = rotation;
     PhysicsBody.Body.Position = pos;
 }
Exemple #2
0
 public ScreenManager(AbyssGame g)
 {
     Game = g;
     gameScreen = new GameScreen(Game);
     ScreenStack = new Stack<Screen>();
     ScreenStack.Push(gameScreen);
 }
Exemple #3
0
 public PhysicsObject(GameScreen screen, float w, float h)
     : base(screen)
 {
     width = w;
     height = h;
     createBody(ref screen.world);
     PhysicsBody.UserData = this;
 }
Exemple #4
0
 public MapLayer(GameScreen screen, Tiled.Map map, string layer, float zindex)
     : base(screen)
 {
     Screen = screen;
     m_map = map;
     m_layer = layer;
     Zindex = zindex;
 }
Exemple #5
0
        public Character(GameScreen screen, float width, float height)
            : base(screen, width, height)
        {
            PhysicsBody.Body.BodyType = BodyType.Dynamic;

            PhysicsBody.OnCollision += onCollision;
            PhysicsBody.OnSeparation += onSeperation;

            //initialize the particle effect
            dustKickUpParticle = new ParticleEntity(screen, "Dust");
            screen.addObject(dustKickUpParticle);
            timeTillEndJumpAnim = 0;
            timeTillEndJumpPrep = 0;
        }
Exemple #6
0
        public Goblin(GameScreen screen, SpawnPoint spawn)
            : base(screen, COLLISION_WIDTH, COLLISION_HEIGHT)
        {
            MaxSpeed = PATROL_SPEED;
            MaxAirSpeed = 9;
            JumpHeight = 50;
            LongJumpBonus = 15;
            MovementAccel = 10;
            AirAccel = 2;

            //set scale
            Scale = 1.0f;

            Zindex = 0.4f;

            loadSprite("Animations/goblin_placeholder");

            Position = UnitConverter.ToSimUnits(spawn.Position);
            Post = Position;

            if (spawn.Properties.ContainsKey("PatrolRadius"))
                PatrolRadius = float.Parse(spawn.Properties["PatrolRadius"]);

            if (spawn.Properties.ContainsKey("MaxRange"))
                MaxRange = float.Parse(spawn.Properties["MaxRange"]);

            if (spawn.Properties.ContainsKey("waitTimeBetweenPatrols"))
                MaxRange = float.Parse(spawn.Properties["waitTimeBetweenPatrols"]);

            if (spawn.Properties.ContainsKey("PostX") && spawn.Properties.ContainsKey("PostY"))
            {
                Post = new Vector2(float.Parse(spawn.Properties["PostX"]),
                    float.Parse(spawn.Properties["PostY"]));
            }

            state = EnemyState.PATROLING;
        }
Exemple #7
0
 public GameObject(GameScreen screen)
     : base(screen.Game)
 {
     environment = screen;
 }