public void personality(GameTime gameTime) //this dictats how people act { if (m_eWanderType == AIWanderType.AI_Scatter) { m_vTargetLocation += position; m_fIdleTime = 0.0f; m_bIsMoving = true; } else if (m_eWanderType == AIWanderType.AI_Random) { BasicMove(gameTime); } else if (m_eWanderType == AIWanderType.AI_drawn) { m_vTargetLocation += position; m_fIdleTime = 0.0f; m_bIsMoving = true; } else if (m_eWanderType == AIWanderType.AI_Freeze) { m_bIsMoving = true; this.m_fAge = 0; // dont add to the age therefore they dont die } else if (m_eWanderType == AIWanderType.AI_None) { } //if there is an event case it time is set by the ack and it keeps going until the event is over if (eventTime < currentTime) { m_eWanderType = AIWanderType.AI_Random; } currentTime += 0.05f; }
public NPCObject(Vector2 position, Sprite sprite) : base() { this.sprite = sprite; this.position = position; m_bIsMoving = false; m_vTargetLocation = new Vector2(); m_fSpeed = 50.0f; m_fWaitTime = 1.0f; m_fIdleTime = 0.0f; m_eWanderType = AIWanderType.AI_Random; Firecracker.engineInstance.numPeoples++; m_fDeathAt = (float)Firecracker.random.NextDouble() * 5 + 5 + (100.0f * (Firecracker.engineInstance.numPeoples / 500.0f)); m_bKillable = true; }