// 1. List<pos + DateTime (class)> // högre och högre tid på olika pos // 2. bild i ps, rita cirklar dra streck mellan dom.. // 3. bygga på med vinklar (sist, till att börja med kör vi med position) public override void Initialize(GameContext context) { base.Initialize(context); snapShots = new List<Snapshot>(); snapShots.Add(new Snapshot(TimeSpan.FromSeconds(0), new Vector2(487.0f, 585.0f))); snapShots.Add(new Snapshot(TimeSpan.FromSeconds(3), new Vector2(510.0f, 200.0f))); snapShots.Add(new Snapshot(TimeSpan.FromSeconds(7), new Vector2(775.0f, 326.0f))); snapShots.Add(new Snapshot(TimeSpan.FromSeconds(10), new Vector2(1142.0f, 103.0f))); this.spriteBatch = spriteBatch ?? new SpriteBatch(Context.Graphics.Device); time = ""; interpolate = new Vector2(); gameServer = ServiceLocator.Get<IGameServer>(); gameClient = ServiceLocator.Get<IGameClient>(); messageHandler = ServiceLocator.Get<IMessageHandler>(); // Create the connection between the client and server gameServer.Start(); gameClient.Connect(); //sendTimer = new GameTimer(TimeSpan.FromMilliseconds(1000 / 20), SendClientSpatial); Context.Input.Keyboard.ClearMappings(); Context.Input.Keyboard.AddMapping(Keys.F1); Context.Input.Keyboard.AddMapping(Keys.F2); Context.Input.Keyboard.AddMapping(Keys.F3); }
public void Initialize(GameContext context) { this.context = context; Percentage = 100; Amount = 100; }
public void Initialize(GameContext context) { for (int i = 0; i < Scenes.Count; i++) { Scenes[i].Initialize(context); } }
public override void Initialize(GameContext context) { base.Initialize(context); globalSettings = ServiceLocator.Get<GlobalSettings>(); gameClient = ServiceLocator.Get<IGameClient>(); }
public override void Initialize(GameContext context) { base.Initialize(context); audioHandler = ServiceLocator.Get<IAudioHandler>(); soundTimer = new GameTimer(TimeSpan.FromMilliseconds(500)); }
public void Initialize(GameContext context) { RadarEntities = new List<RadarEntity>(); radarBaseImage = context.Resources.Textures["Gui.Hud.Radar"]; radarCompass = context.Resources.Textures["Gui.Hud.RadarCompass"]; radarEntityImage = context.Resources.Textures["Gui.Hud.RadarEntity"]; }
public void Initialize(GameContext context, int capacity) { this.context = context; this.capacity = capacity; items = new List<NotificationItem>(capacity); fadeTimer = new GameTimer(TimeSpan.FromMilliseconds(50)); }
public override void Initialize(GameContext context) { base.Initialize(context); gui = new GuiManager(Context.Input, Context.Graphics.Device, Context.Graphics.SpriteBatch); buttons = new List<Button>(); // Enable the mouse in this scene Context.Input.Mouse.AutoCenter = false; context.Input.Mouse.ShowCursor = true; }
public override void Initialize(GameContext context) { base.Initialize(context); gui = new GuiManager(Context.Input, Context.Graphics.Device, Context.Graphics.SpriteBatch); InitializeInput(); audioHandler = ServiceLocator.Get<IAudioHandler>(); context.Input.Mouse.ShowCursor = true; context.Input.Mouse.AutoCenter = false; }
public void Initialize(TerrainVisibility terrainVisibility, GameContext context) { this.terrainVisibility = terrainVisibility; this.context = context; RenderStateContext = new RenderStateContext(); VisibleTerrainMeshes = new Dictionary<TileType, List<TerrainMesh>>(); Logger.RegisterLogLevelsFor<TerrainRenderer>(Logger.LogLevels.Adaptive); // Start the worker thread ThreadingContext.Start(AddAsyncLogic); }
/// <summary> /// Default constructor /// </summary> public InputContext(GameContext context) { // Initialize the mouse Mouse = new MouseHandler(context); // Initialize the keyboard Keyboard = new KeyboardHandler(context); // Initialize the gamepad GamePad = new GamePadHandler(); // Initialize the bindings handler Bindings = new BindingsHandler(Mouse, Keyboard, GamePad); }
public void Initialize(GameContext context, Entity player, List<ServerEntity> clients) { this.player = player; this.clients = clients; playerSpatial = player.Components.Get<SpatialComponent>(); Radar = new Radar(84.0f, 12.0f); Radar.Initialize(context); Radar.Center = playerSpatial.Position; messageHandler = ServiceLocator.Get<IMessageHandler>(); for(int i = 0; i < clients.Count; i++) { var client = clients[i]; var radarEntityA = new RadarEntity(); radarEntityA.Opacity = 1.0f; radarEntityA.Color = Color.LightGreen; radarEntityA.Position = client.Position; radarEntityA.Id = client.Id; Radar.RadarEntities.Add(radarEntityA); } //var radarEntityA = new RadarEntity(); //radarEntityA.Opacity = 1.0f; //radarEntityA.Color = Color.Yellow; //radarEntityA.Position = new Vector3(-14, 42, -23); //radarEntityA.Id = 99; //var radarEntityB = new RadarEntity(); //radarEntityB.Opacity = 1.0f; //radarEntityB.Color = Color.Red; //radarEntityB.Position = new Vector3(51, 45, -22); //radarEntityB.Id = 98; //var radarEntityC = new RadarEntity(); //radarEntityC.Opacity = 1.0f; //radarEntityC.Color = Color.LightGreen; //radarEntityC.Position = new Vector3(120, 38, 65); //radarEntityC.Id = 97; //Radar.RadarEntities.Add(radarEntityA); //Radar.RadarEntities.Add(radarEntityB); //Radar.RadarEntities.Add(radarEntityC); }
public override void Initialize(GameContext context) { base.Initialize(context); stringBuilder = new StringBuilder(100, 500); gameServer = ServiceLocator.Get<IGameServer>(); gameClient = ServiceLocator.Get<IGameClient>(); // Create the connection between the client and server gameServer.Start(); gameClient.Connect(); startedLoading = false; hasRenderedContent = false; }
public static void Initialize(TerrainVisibility terrainVisibility, GameContext context) { Builder = new AreaModelBuilder(terrainVisibility); }
public SceneManager(GameContext context) { this.context = context; Scenes = new List<SceneBase>(); }
public FpsCounter(GameContext context) { this.context = context; }
public void Initialize(GameContext context, Vector2i viewDistance, Vector3 gravity, int seed) { TerrainContext = new TerrainContext(context, viewDistance, seed); PhysicsHandler = new JitterPhysicsHandler(gravity); EntityHandler = new EntityHandler(); }