Rozsvěcení a zhasínání světel, sprity pro místnosti, indikátory rozsvícených světel, po konci hry je hráč vrácen do hlavního menu
This commit is contained in:
parent
25a62af483
commit
55fd052072
27 changed files with 338 additions and 113 deletions
33
FNAF_Clone/GUI/EnemyUIElement.cs
Normal file
33
FNAF_Clone/GUI/EnemyUIElement.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using MonoGameLibrary.Graphics;
|
||||
|
||||
namespace FNAF_Clone.GUI;
|
||||
|
||||
public class EnemyUIElement : UIElement {
|
||||
private int unlitTexturesId;
|
||||
private bool currentlyLit = true;
|
||||
|
||||
public EnemyUIElement(TextureRegion litTexture, TextureRegion unlitTexture, Point position, int drawPriority = 0) : base([litTexture, unlitTexture], position, drawPriority) {
|
||||
unlitTexturesId = 1;
|
||||
}
|
||||
|
||||
public EnemyUIElement(TextureRegion[] litTextures, TextureRegion[] unlitTextures, Point position, int drawPriority = 0) : base(litTextures.Concat(unlitTextures).ToArray(), position, drawPriority) {
|
||||
unlitTexturesId = litTextures.Length;
|
||||
}
|
||||
|
||||
public void SetTexture(bool lit, int id) {
|
||||
currentlyLit = lit;
|
||||
base.SetTexture(lit ? id : id + unlitTexturesId);
|
||||
}
|
||||
|
||||
public override void SetTexture(int id) {
|
||||
base.SetTexture(currentlyLit ? id : id + unlitTexturesId);
|
||||
}
|
||||
|
||||
public void SetTexture(bool lit) {
|
||||
if(lit == currentlyLit) return;
|
||||
currentlyLit = lit;
|
||||
SetTexture(lit ? currentTextureId - unlitTexturesId : currentTextureId);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue