public Character(Vector2 position, SpriteSheet sheet) { velocity = new Vector2(0, 0); target = new Vector2(); steering = new SteeringManager(this); this.position = position; this.collisionHandler = new CharacterCollider(this); }
public Mech(Vector2 position, SpriteSheet sheet) : base(position, sheet) { int health = 100; graphics = new Animation(); graphics.Initialize(sheet, 100, true, this.position, 0, 7, 1); this.pixelsMovedPerSec = 90; this.maxForcePerSec = 10; this.mass = 3; this.collisionMasks.Add(new Collision.CollidableCircle() { centerPos = new Vector2(0,0), radius = 50.0f }); }
public override void Initialize() { font = theContent.Load<SpriteFont>("SpriteFont1"); texture = theContent.Load<Texture2D>("Graphics/Mechs/Mech2/Mech2Walk"); texture2 = theContent.Load<Texture2D>("Graphics/Mechs/Mech2/Mech2Walk"); test = new SpriteSheet(texture, 96, 96, 7, 3); test2 = new SpriteSheet(texture2, 96, 96, 7, 3); testCharacter = new Mech(new Vector2(100, 100), test); testCharacter2 = new Mech(new Vector2(500, 500), test2); entities = new List<Entity>(); entities.Add(testCharacter2); entities.Add(testCharacter); MapInit(); collider = new Collider(); base.Initialize(); }
public void Initialize(SpriteSheet theSpriteSheet, float frameDuration, bool isLooping, Vector2 thePosition, int startCol, int endCol, int spriteRow) { //Assigning param values to class variables this.spriteSheet = theSpriteSheet; this.elapsedTime = 0; this.displayDuration = frameDuration; this.looping = isLooping; this.position = thePosition; this.currentCol = startCol; this.currentRow = spriteRow; this.endCol = endCol; this.startCol = startCol; //Setting the starting point for spritesheet this.spriteSheet.setFrame(startCol, spriteRow); this.sourceDestination = this.spriteSheet.getFrame(startCol, spriteRow); }