public LevelCollisionObject(Vector2 _pos, OrientedBoundingBox _obb, Type _type, bool isIgnored = false) { position = _pos; OBB = _obb; objectType = _type; isIgnoredByEnemies = isIgnored; }
public GameSprite(Texture2D initialTexture, Vector2 initialPosition, bool _isAnimated) { images = new List<Texture2D>(); images.Add(initialTexture); position = initialPosition; origin = Vector2.Zero; isVisible = true; mAnimationList = new List<AnimationData>(); isAnimated = _isAnimated; staticOBB = new OrientedBoundingBox(new Vector2(images[0].Width / 2, images[0].Height / 2), 0, new Vector2(images[0].Width / 2, images[0].Height / 2)); }
public GameSprite(Texture2D initialTexture, Vector2 initialPosition) { image = initialTexture; position = initialPosition; if (initialTexture != null) spriteRectangle = new Rectangle((int)position.X, (int)position.Y, image.Width, image.Height); origin = Vector2.Zero; isVisible = true; mAnimationList = new List<AnimationData>(); isAnimated = false; staticOBB = new OrientedBoundingBox(new Vector2(image.Width / 2, image.Height / 2), 0, new Vector2(image.Width / 2, image.Height / 2)); }
//Adds a new OBB to a specific animation public void AddOBB(int index,bool isAttack, Vector2 origin, Vector2 halfWidths,float angle) { if (isAnimated) { if (isAttack) { mAnimationList[index].mOBBDamage.Add(new OrientedBoundingBox(origin, angle, halfWidths)); } else { mAnimationList[index].mOBBGeneral.Add(new OrientedBoundingBox(origin, angle, halfWidths)); } } else { staticOBB = new OrientedBoundingBox(origin, angle, halfWidths); } }