// Use this for initialization void Start() { rrand = Random.Range(0, 100); food_hold = 0; last_hunger = Time.time; last_action = Time.time; last_sleep = Time.time + Random.Range(0, sleep_interval); last_mating = Time.time + Random.Range(mating_cooldown / 2, mating_cooldown); nextNode = mySquare; currentDestination = mySquare; wg = GameObject.FindGameObjectWithTag("world").GetComponent <WorldGen>(); wl = GameObject.FindGameObjectWithTag("world").GetComponent <WorldLogic>(); rf = gameObject.GetComponent <RabbitFinder>(); rm = gameObject.GetComponent <RabbitMover>(); ng = gameObject.GetComponent <NameGen>(); rm.SetPosition(wg.VertexToVector3(mySquare)); anim = gameObject.GetComponent <Animator>(); ng = gameObject.GetComponent <NameGen>(); //initiate rabbit stats myname = ng.getName(); hp = 20; maxhp = 20; hunger = 7; full = 10; str = Random.Range(1, 4); spd = Random.Range(1, 4); speed = 1 / (float)spd; if (!starting_rabbit) { profession = "Guard"; sex = Random.Range(0, 2); } }
//////////////// public override void Initialize() { var mymod = NihilismMod.Instance; this.Logic = new WorldLogic(); if (NihilismConfig.Instance.DebugModeInfo) { LogLibraries.Alert("World initialized."); } }
private void Awake() { _performanceTimer = new Stopwatch(); _worldLogic = new WorldLogic(playersPool, minimap); _players = new Player[PlayersCount]; for (var i = 0; i < _players.Length; i++) { _players[i] = new Player(); _players[i].ChangeHp(); _players[i].ChangePosition(); } }
// Use this for initialization void Start() { tunnels = Resources.LoadAll <Sprite>("tunnels"); grasses = Resources.LoadAll <Sprite>("grasses"); wl = gameObject.GetComponent <WorldLogic>(); prefabs = new GameObject[width, height]; InstantiateWorld(); world = new int[width, height]; BuildGround(); DrawGround(); wl.PopulateWorld(); }
public BoidColony(Color color,Vector2 position, WorldLogic.World world) { InitializeComponent(); IsBoidsCountLimited = false; Boids = new List<BoidControl>(); Position = position; ColonyColor = color; Rect.Fill = new SolidColorBrush(color); World = world; GiveBirthToANiceBoid(this, new EventArgs()); }
// Use this for initialization void Start() { next_node = pos; hp = maxhp; last_action = Time.time; wg = GameObject.FindGameObjectWithTag("world").GetComponent<WorldGen>(); wl = GameObject.FindGameObjectWithTag("world").GetComponent<WorldLogic>(); rf = gameObject.GetComponent<RabbitFinder>(); rm = gameObject.GetComponent<RabbitMover>(); rm.SetPosition(wg.VertexToVector3(pos)); Camera.main.gameObject.GetComponent<CameraMove>().SetPosition(pos); }
// Use this for initialization void Start() { next_node = pos; hp = maxhp; last_action = Time.time; wg = GameObject.FindGameObjectWithTag("world").GetComponent <WorldGen>(); wl = GameObject.FindGameObjectWithTag("world").GetComponent <WorldLogic>(); rf = gameObject.GetComponent <RabbitFinder>(); rm = gameObject.GetComponent <RabbitMover>(); rm.SetPosition(wg.VertexToVector3(pos)); Camera.main.gameObject.GetComponent <CameraMove>().SetPosition(pos); }
private void Start() { _worldLogic = GameObject.Find("World Logic").GetComponent <WorldLogic>(); if (_worldLogic == null) { Debug.LogError("World Logic is NULL!"); } else { _borderY = _worldLogic.BorderY; } }
//////////////// public override void Initialize() { var mymod = (ModHelpersMod)this.mod; this.ObsoleteId = Guid.NewGuid().ToString("D"); this.ObsoleteId2 = WorldHelpers.GetUniqueId(false); this.HasObsoleteId = false; // 'Load()' decides if no pre-existing one is found this.WorldLogic = new WorldLogic(); if (String.IsNullOrEmpty(this.ObsoleteId2)) { throw new HamstarException("UID not defined."); } }
// Use this for initialization void Start() { if (reload) { game_over = false; reload = false; } if (!game_over) { scroll = Screen.height - 300; myPastRabbits = null; profession = Guard; wl = GameObject.FindGameObjectWithTag("world").GetComponent <WorldLogic>(); currentRabbit = GameObject.FindGameObjectsWithTag("Rabbit")[0].GetComponent <RabbitLogic>(); } }
void Start() { transform.Translate(new Vector3(0, 0, 0)); _worldLogic = GameObject.Find("World Logic").GetComponent <WorldLogic>(); if (_worldLogic == null) { Debug.LogError("World Logic is NULL!"); } else { _speed = _worldLogic.SpaceSpeed; _spaceNum = _worldLogic.SpaceNum; _player = _worldLogic.Player; } }
private void Start() { _worldLogic = GameObject.Find("World Logic").GetComponent <WorldLogic>(); if (_worldLogic == null) { Debug.LogError("World Logic is NULL"); } else { _speed = _worldLogic.AsteroidSpeed; } _spawnManager = GameObject.Find("SpawnManager").GetComponent <SpawnManager>(); if (_spawnManager == null) { Debug.LogError("Spawn manager is NULL"); } _isActive = true; }
// Use this for initialization void Start() { if(reload){ game_over = false; reload = false; } if(!game_over){ scroll = Screen.height - 300; myPastRabbits = null; profession = Guard; wl = GameObject.FindGameObjectWithTag("world").GetComponent<WorldLogic>(); currentRabbit = GameObject.FindGameObjectsWithTag("Rabbit")[0].GetComponent<RabbitLogic>(); } }
//////////////// public override void Initialize() { this.Logic = new WorldLogic(); LogHelpers.Alert(""); }
// Use this for initialization void Start() { rrand = Random.Range(0, 100); food_hold = 0; last_hunger = Time.time; last_action = Time.time; last_sleep = Time.time + Random.Range(0, sleep_interval); last_mating = Time.time + Random.Range(mating_cooldown/2, mating_cooldown); nextNode = mySquare; currentDestination = mySquare; wg = GameObject.FindGameObjectWithTag("world").GetComponent<WorldGen>(); wl = GameObject.FindGameObjectWithTag("world").GetComponent<WorldLogic>(); rf = gameObject.GetComponent<RabbitFinder>(); rm = gameObject.GetComponent<RabbitMover>(); ng = gameObject.GetComponent<NameGen>(); rm.SetPosition(wg.VertexToVector3(mySquare)); anim = gameObject.GetComponent<Animator>(); ng = gameObject.GetComponent<NameGen>(); //initiate rabbit stats myname = ng.getName(); hp = 20; maxhp = 20; hunger = 7; full = 10; str = Random.Range(1,4); spd = Random.Range(1,4); speed = 1 / (float)spd; if(!starting_rabbit){ profession = "Guard"; sex = Random.Range(0,2); } }
public void Go(Vector2 dest, WorldLogic.World world) { if (this.Action != null) { _steerForce = this.Action.DoAction(dest, _position, _velocity, _maxSpeed); _steerForce = Vector2.Truncate(_steerForce, _maxForce); _acceleration = _steerForce / _mass; _velocity = Vector2.Truncate(_velocity + _acceleration, _maxSpeed); Position = CheckBoundaries(Vector2.Add(_velocity, Position), (int)world.WorldHeight, (int)world.WorldWidth); //Logger.Save(CreateLog()); } }
// Use this for initialization void Start() { tunnels = Resources.LoadAll<Sprite>("tunnels"); grasses = Resources.LoadAll<Sprite>("grasses"); wl = gameObject.GetComponent<WorldLogic>(); prefabs = new GameObject[width,height]; InstantiateWorld(); world = new int[width, height]; BuildGround(); DrawGround(); wl.PopulateWorld(); }
// Use this for initialization void Start() { wl = GameObject.FindGameObjectWithTag("world").GetComponent<WorldLogic>(); wg = GameObject.FindGameObjectWithTag("world").GetComponent<WorldGen>(); transform.position = new Vector3(Mathf.RoundToInt(wg.transform.position.x + (wg.width / 2)), Mathf.RoundToInt(wg.transform.position.y - (wg.height / 2)), transform.position.z); }
// Use this for initialization void Start() { wl = GameObject.FindGameObjectWithTag("world").GetComponent <WorldLogic>(); wg = GameObject.FindGameObjectWithTag("world").GetComponent <WorldGen>(); transform.position = new Vector3(Mathf.RoundToInt(wg.transform.position.x + (wg.width / 2)), Mathf.RoundToInt(wg.transform.position.y - (wg.height / 2)), transform.position.z); }
// World Map public WorldLogic GetWorldLogic() { if( null == m_WorldLogic ) { m_WorldLogic = new WorldLogic( this ); } return m_WorldLogic; }