//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace DarkWynter.Game.GameObjects { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Storage; using System.Xml; using System.Diagnostics; using System.Threading; using DarkWynter.Engine; using DarkWynter.Engine.Globals; using DarkWynter.Engine.ObjectLib; using DarkWynter.Engine.GameObjects; using DarkWynter.Engine.Controllers; using DarkWynter.Engine.UserInterface; using DarkWynter.Stream; using DarkWynter.Engine.Init; using Xclna.Xna.Animation; using DarkWynter.Engine.EventControl; #endregion public class ThoughtsAI : AI { public Vector3 whereAreYou = new Vector3(); /// /// Constructor /// public ThoughtsAI(Load gameObjectLoader) : base(gameObjectLoader) { this.mass.movementType = Enums_Engine.MovementType.WALK; this.mass.SetPosition(new Vector3(1243, 22, 857), Vector3.Zero); } public override void Update(ref ObjectLibrary objectLibrary) { // Initialize the AI if (this.mass.currentPosition == new Vector3 (0, 22, 0)) { this.mass.SetPosition(new Vector3(1253, 22, 857), Vector3.Zero); } if (destination != null && destination != Vector3.Zero) { if (!destinationReached) { //mass.AddForce(new Vector3(20, 0, 20)); Vector3 diff = goToDestination(destination); if (diff.Length() < 50) { destinationReached = true; } } } // If dead they can't update if (IsAlive() == false) { return; } // Turn terrain mod back off terrainModEnabled = false; base.Update(ref objectLibrary); } public override bool ObjectCollisionResponse(GameObject collidedObject, Vector3 resultantForce, ObjectLibrary objectLibrary) { return base.ObjectCollisionResponse(collidedObject, resultantForce, objectLibrary); } public override void Draw_Billboards(ObjectLibrary objectLibrary, BillboardList gameObjectBillboards) { base.Draw_Billboards(objectLibrary, gameObjectBillboards); Texture2D billboardImage = Statics_Engine.SystemSettings.content.Load("Content/_textures/bomb1"); List billboards = new List(); Vector3 offset = mass.currentPosition; //offset.Y += 50; Billboard billboard = new Billboard(null); billboard.Load(mass.currentPosition + offset, Vector3.Zero, 50.0f, 50.0f, draw.textureList[0]); //billboard.Load(mass.currentPosition + offset, Vector3.Zero, 15.0f, 15.0f, Engine.DarkWynterEngine.video.CurrentTexture); billboards.Add(billboard); // Add a billboard texture above the particle // draw all billboard in list for (int i = 0; i < billboards.Count; i++) { gameObjectBillboards.Add(billboards[i] as IBillboard); } } } }