public void InitPlayers(int cageId) { var player1 = EntityManager.GetEntityManager().NewEntity(); var actionBindings1 = new ActionBindingsBuilder() .SetAction(Keys.W, EventConstants.WalkForward) //Use of the next gen constants :) .SetAction(Keys.S, EventConstants.WalkBackward) .SetAction(Keys.A, EventConstants.TurnLeft) .SetAction(Keys.D, EventConstants.TurnRight) .SetAction(Keys.Q, EventConstants.TurnAround) .SetAction(Keys.E, EventConstants.FireWeapon) .SetAction(Keys.LeftShift, EventConstants.LightStatus) .Build(); var player2 = EntityManager.GetEntityManager().NewEntity(); var actionBindings2 = new ActionBindingsBuilder() .SetAction(Keys.I, EventConstants.WalkForward) .SetAction(Keys.K, EventConstants.WalkBackward) .SetAction(Keys.J, EventConstants.TurnLeft) .SetAction(Keys.L, EventConstants.TurnRight) .SetAction(Keys.O, EventConstants.FireWeapon) .SetAction(Keys.U, EventConstants.TurnAround) .SetAction(Keys.H, EventConstants.Running) .Build(); var player3 = EntityManager.GetEntityManager().NewEntity(); var actionBindings3 = new ActionBindingsBuilder() .SetAction(Keys.Up, EventConstants.WalkForward) .SetAction(Keys.Down, EventConstants.WalkBackward) .SetAction(Keys.Left, EventConstants.TurnLeft) .SetAction(Keys.Right, EventConstants.TurnRight) .SetAction(Keys.PageDown, EventConstants.FireWeapon) .SetAction(Keys.PageUp, EventConstants.TurnAround) .SetAction(Keys.RightControl, EventConstants.Running) .Build(); CreatePlayer(name: "Carlos", entityId: player1, actionBindings: actionBindings1, position: new Vector2(200, 200), cameraFollow: true, collision: true, isCaged: true, cageId: cageId); CreatePlayer("Elvir", player2, actionBindings2, position: new Vector2(400, 400), cameraFollow: true, collision: true, isCaged: true, cageId: cageId, disabled: false); CreatePlayer("Markus", player3, actionBindings3, position: new Vector2(300, 300), cameraFollow: true, collision: true, isCaged: false, cageId: cageId, disabled: true); }
public void InitPlayers(int cageId) { var player1 = EntityManager.GetEntityManager().NewEntity(); var actionBindings1 = new ActionBindingsBuilder() .SetAction(Keys.W, EventConstants.WalkForward) //Use of the next gen constants :) .SetAction(Keys.S, EventConstants.WalkBackward) .SetAction(Keys.A, "entityTurnLeft") .SetAction(Keys.D, "entityTurnRight") .SetAction(Keys.Q, "entityTurnAround") .SetAction(Keys.E, "entityFireWeapon") .SetAction(Keys.LeftShift, "entityRun") .Build(); var player2 = EntityManager.GetEntityManager().NewEntity(); var actionBindings2 = new ActionBindingsBuilder() .SetAction(Keys.I, "entityWalkForwards") .SetAction(Keys.K, "entityWalkBackwards") .SetAction(Keys.J, "entityTurnLeft") .SetAction(Keys.L, "entityTurnRight") .SetAction(Keys.O, "entityFireWeapon") .SetAction(Keys.U, "entityTurnAround") .SetAction(Keys.H, "entityRun") .Build(); var player3 = EntityManager.GetEntityManager().NewEntity(); var actionBindings3 = new ActionBindingsBuilder() .SetAction(Keys.Up, "entityWalkForwards") .SetAction(Keys.Down, "entityWalkBackwards") .SetAction(Keys.Left, "entityTurnLeft") .SetAction(Keys.Right, "entityTurnRight") .SetAction(Keys.PageDown, "entityFireWeapon") .SetAction(Keys.PageUp, "entityTurnAround") .SetAction(Keys.RightControl, "entityRun") .Build(); CreatePlayer(player1, actionBindings1, position: new Vector2(200, 200), cameraFollow: true, collision: true, isCaged: true, cageId: cageId); CreatePlayer(player2, actionBindings2, position: new Vector2(400, 400), cameraFollow: true, collision: true, disabled: true); CreatePlayer(player3, actionBindings3, position: new Vector2(300, 300), cameraFollow: true, collision: true, isCaged: true, disabled: true); }