public cWorld(cGameScene p_scene, Vector2u window_size) { pScene = p_scene; windowSize = window_size; drawTileBounds = new cAABB(0, 0, 1, 1); m_Level1 = new cMapData(); //m_Level1.Create(100, 100); this.LoadLevel("levels/level1.txt"); //("levels/level1.txt"); m_TextureOfTiles = new RenderTexture((uint)m_WorldBounds.dims.X, (uint)m_WorldBounds.dims.Y); //(windowSize.X, windowSize.Y); m_TextureOfTiles.SetActive(true); m_TileSetTexture = cAssetManager.GetTexture("tileSet_16"); m_TileSetTexture.Smooth = true; m_BGtexture = cAssetManager.GetTexture(Constants.BG_TEXTURE); m_BGtexture.Repeated = true; m_BGtexture.Smooth = true; background = new Sprite(m_BGtexture); background.TextureRect = new IntRect(0, 0, (int)m_WorldBounds.dims.X, (int)m_WorldBounds.dims.Y); // (int)m_TextureOfTiles.Size.X, (int)m_TextureOfTiles.Size.Y); background.Color = Constants.BACKGROUND_COLOR; tempSprite = new Sprite(m_TileSetTexture); }
public void ChangeGameState(cGameScene new_state) { if (m_CurrentState != null) { m_CurrentState.Exit(); } //m_LastState = m_CurrentState; m_CurrentState = new_state; m_CurrentState.Enter(); }
//Dictionary<int, cGameObject> entityMap; public cEntityPool(cGameScene scene, Vector2f world_size, cPlayer p_player) { this.pScene = scene; this.worldSize = world_size; this.pPlayer = p_player; this.bullets = new List <cBullet>(); this.monsters = new List <cMonster>(); this.treeMonsters = new cQuadTree <cMonster>(1, scene.World.WorldBounds); this.pickups = new Dictionary <int, cPickupAble>(); this.spatialGrid = new cSpatialGrid(worldSize); //this.treeBullets = new cQuadTree<cBullet>(1, scene.World.WorldBounds); }