public ObjectManager(GameState _game_state) { game_state = _game_state; obj_hash = new objectType[NUM_OBJECTS]; item_hash = new itemType[NUM_OBJECTS]; for (int i = 0; i < NUM_OBJECTS; ++i) { if ((i >= 63 && i <= 67) || (i >= 81 && i <= 84)) //Object ids on the sheet { obj_hash[i] = objectType.ITEM; } else if (i >= 70 && i <= 80) { obj_hash[i] = objectType.SPAWN; } else { obj_hash[i] = objectType.SCENERY; } item_hash[i] = itemType.NONE; } item_hash[65] = itemType.SWORD; item_hash[63] = itemType.LASER; item_hash[66] = itemType.ATT_BOOST; item_hash[67] = itemType.DEF_BOOST; item_hash[83] = itemType.KEY; }
public CollisionEngine(GameState _game_state) { game_state = _game_state; unique_id = 0; all_objects = new List<ColToken>(); marked_objects = new List<ColToken>(); }
public MonsterEngine(GameState _game_state) { game_state = _game_state; monsters = new List<Enemy>(); LoadDecisionMatrix(); }
List<Effect> to_draw; // which effect #endregion Fields #region Constructors public EffectsEngine(GameState _game_state) { game_state = _game_state; all_effects = new List<Effect>(); to_draw = new List<Effect>(); sounds = new SoundEffect[(int)soundType.NUM_S_TYPES]; expls = new Sprite[(int)explosionType.NUM_E_TYPES]; }
public PathFind(GameState _game_state) { // Node t = open_list.Max(nodey => nodey); game_state = _game_state; back_layer = game_state.tile_engine.getCurrentMap().getLayer(LayerType.BACKGROUND); int tile_dim_x = game_state.tile_engine.getCurrentMap().getWidth(); int tile_dim_y = game_state.tile_engine.getCurrentMap().getHeight(); which_list = new WhichList[tile_dim_x, tile_dim_y]; closed_list = new Node[tile_dim_x, tile_dim_y]; for (int i = 0; i < tile_dim_x; ++i) { for (int j = 0; j < tile_dim_y; ++j) { WhichList item = which_list[i, j]; item = WhichList.NONE; } } }
//*****************************************************// public GameEngine(TimeExpired t, GameOver g) { backpackmenu = new Backpack(); timex = t; gameOver = g; character_sprite = new Sprite[(int)weaponType.GRENADE]; character_sprite[(int)weaponType.NONE] = new Sprite(); character_sprite[(int)weaponType.SWORD] = new Sprite(); character_sprite[(int)weaponType.LASER] = new Sprite(); monster_texture = new Texture2D[(int)enemyType.NUM_ENEM]; bullet_sprite = new Sprite(); sword_sprite = new Sprite(); game_state = new GameState(); game_state.local_player = new Player(33, 0, 32, 36); game_state.monster_engine = new MonsterEngine(game_state); game_state.coll_engine = new CollisionEngine(game_state); game_state.fx_engine = new EffectsEngine(game_state); game_state.obj_mang = new ObjectManager(game_state); //instantiate each type of object, respectively game_state.local_player.col_tok = game_state.coll_engine.register_object(game_state.local_player, ColType.PLAYER); }
//*****************************************************// public GameEngine(TimeExpired t, GameOver g) { backpackmenu = new Backpack(); timex = t; gameOver = g; character_sprite = new Sprite[(int)weaponType.GRENADE]; character_sprite[(int)weaponType.NONE] = new Sprite(); character_sprite[(int)weaponType.SWORD] = new Sprite(); character_sprite[(int)weaponType.LASER] = new Sprite(); monster_texture = new Texture2D[(int)enemyType.NUM_ENEM]; bullet_sprite = new Sprite(); sword_sprite = new Sprite(); game_state = new GameState(); game_state.local_player = new Player(33, 0, 32, 36); //game_state.local_player.setWeapon(weaponType.SWORD); game_state.monster_engine = new MonsterEngine(game_state); game_state.coll_engine = new CollisionEngine(game_state); game_state.fx_engine = new EffectsEngine(game_state); game_state.obj_mang = new ObjectManager(game_state); game_state.local_player.col_tok = game_state.coll_engine.register_object(game_state.local_player, ColType.PLAYER); //Content.RootDirectory = "Content"; // Frame rate is 30 fps by default for Windows Phone. //TargetElapsedTime = TimeSpan.FromTicks(333333); }
public BulletEngine(GameState _game_state) { game_state = _game_state; bullets = new List<Bullet>(); }