void loadGeneral(ContentManager content, GameWindow Window) { // Lebensanzeige this._textureHeartSlice = content.Load <Texture2D>("Sprites/Misc/HealthSlices"); this._liveHUD = new HealthSliceTexture(this._textureHeartSlice); //Goldanzeige this._textureGoldCoin = content.Load <Texture2D>("Sprites/Misc/coin"); this._fnt = content.Load <SpriteFont>("Fonts/MarioFont"); this._coinCount = new GoldCoinTexture(this._textureGoldCoin, this._fnt); // Spieler this._texturePlayer = content.Load <Texture2D>("Sprites/Character/PlayerSprite"); this._player = new JumpCharacter(this._world, this._startPos, 25, 32, 5.5f, this._texturePlayer); // Kameraposition this._cam.Pos = new Vector2(Window.ClientBounds.Width / 2 - 1, Window.ClientBounds.Height / 2); }
public bool killGeneral() { if (!this._isDisposed) { /* Darf die Texturen nicht schmeißen, da sonst exception */ this._textureHeartSlice = null; //.Dispose(); this._texturePlayer = null; //.Dispose(); this._world.BodyList.Clear(); this._world = null; this._cam = null; this._liveHUD = null; this._player = null; this._isDisposed = true; return(this._isDisposed); } return(false); }
void Start() { jumpCharacter = GetComponentInParent <JumpCharacter>(); }