public cMonster(GameScene scene, Vector2f pos) : base(scene, pos) { p_followLight = new cLight(); p_followLight.Pos = this.Bounds.center; p_followLight.Radius = 100.0f; p_followLight.LinearizeFactor = 0.4f; p_followLight.Bleed = 2.0f; p_followLight.OriginalColor = new Color(239, 129, 37); p_followLight.Color = new Color(239, 129, 37); // new Color(20, 184, 87); this.Scene.LightMap.AddStaticLight(p_followLight); eye = new cLight(); eye.Radius = 10.0f; eye.LinearizeFactor = 0.98f; eye.Bleed = 5.0f; eye.OriginalColor = new Color(255, 39, 13); eye.Color = new Color(255, 39, 13); this.Scene.LightMap.AddStaticLight(eye); this.sleep(); bloom = new Sprite(Scene.Assets.GetTexture("bloom")); bloom.Scale = new Vector2f(0.2f, 0.2f); bloom.Origin = new Vector2f(bloom.Texture.Size.X / 2.0f, bloom.Texture.Size.Y / 2.0f); bloom.Color = Color.Red; this.attacking = false; this.attackCharger = new cRegulator(); this.attackCharger.resetByFrequency(2); this.boundingRadius = 12.0f; }
public cWeapon(cGameObject owner, int firing_frequency) { this.owner = owner; this.firingFrequency = firing_frequency; this.regulator = new cRegulator(); this.regulator.resetByFrequency(firing_frequency); this.spread = (float)cAppMath.DegressToRadian(2); }
public cWeapon(cGameObject owner, int firing_frequency, string bullet_breed_id) { this.owner = owner; this.firingFrequency = firing_frequency; this.regulator = new cRegulator(); this.regulator.resetByFrequency(firing_frequency); this.spread = (float)AppMath.DegressToRadian(2); this.bulletsPerShot = 1; this.bulletBreedID = bullet_breed_id; }
private void _init() { _setUpSFML(); //resource-ok betöltése (font-ok és textúrák, képek a játékhoz) appAssets.LoadResources(Constants.FONT_NAMES); m_DeltaTime = 0.0; m_StepTime = 1.0 / 60.0; m_MaxDeltaTime = 0.25; //0.25f m_Accumulator = 0.0; m_Time = 0.0; m_FPS = 0.0; m_Timer = new AppTimer(); //ChangeGameState( new GameScene(this) ); fpsUpdater = new cRegulator(); fpsUpdater.resetByPeriodTime(1.0f); //Idő szöveg timeText = new Text("", appAssets.GetFont("pf_tempesta_seven")); timeText.Position = new Vector2f(this.defaultView.Size.X - 500, 30); timeText.CharacterSize = 28; // in pixels, not points! timeText.FillColor = Color.White; timeText.Style = Text.Styles.Bold; GlobalClock.Start(); // currentState = new GameScene(this); // currentState.Enter(); m_AppRunning = true; definiedStates.Add("main-menu", () => { this.SetGameState(new MainMenu(this)); }); definiedStates.Add("game-scene", () => { this.SetGameState(new GameScene(this)); }); this.ChangeGameState("main-menu"); }