public void CreateObjects(int count) { instance = this; ObjectLink prev = null; for (int i = 0; i < count; ++i) { SpriteAnimation b = GameObject.Instantiate(origin, Vector3.zero, Quaternion.identity).GetComponent <SpriteAnimation>(); b.Initialize(); b.gameObject.name = i.ToString(); ObjectLink link = new ObjectLink(b); if (i == 0) { disableFront = link; } else { prev.back = link; } b.gameObject.SetActive(false); prev = link; } }
public void LoadContent(ContentManager Content) { runTexture = Content.Load <Texture2D>("Sprites/run"); jumpTexture = Content.Load <Texture2D>("Sprites/jump"); slideTexture = Content.Load <Texture2D>("Sprites/bend"); swordTexture = Content.Load <Texture2D>("Sprites/swap"); dieTexture = Content.Load <Texture2D>("Sprites/die"); punchTexture = Content.Load <Texture2D>("Sprites/punch"); Position = new Vector2(150, 474); InitialPosition = Position; runAnimation.Initialize(runTexture, Position, runTexture.Height, runTexture.Height, runTexture.Width / runTexture.Height, 50, Color.White, scale, true); jumpAnimation.Initialize(jumpTexture, new Vector2(Position.X, Position.Y - 160), runTexture.Height, jumpTexture.Height, jumpTexture.Width / runTexture.Height, 80, Color.White, scale, false); slidingAnimation.Initialize(slideTexture, new Vector2(Position.X, Position.Y + 60), slideTexture.Height, slideTexture.Height, slideTexture.Width / slideTexture.Height, 120, Color.White, scale, false); swordAnimation.Initialize(swordTexture, Position, swordTexture.Height, swordTexture.Height, swordTexture.Width / swordTexture.Height, 50, Color.White, scale, false); dieAnimation.Initialize(dieTexture, Position, dieTexture.Height, dieTexture.Height, dieTexture.Width / dieTexture.Height, 40, Color.White, scale, false); punchAnimation.Initialize(punchTexture, Position, punchTexture.Height, punchTexture.Height, punchTexture.Width / punchTexture.Height, 50, Color.White, scale, false); playerAnimation = runAnimation; }
public override void LoadContent() { dumbbellSprite = Content.Load <Texture2D>("Sprites/dumbbell-sprite"); background = Content.Load <Texture2D>("Textures//Gym-Interior"); avatar = Content.Load <Texture2D>("Textures/avatar"); bubbleBox = Content.Load <Texture2D>("Textures/bubbleBoxDumb"); font = Content.Load <SpriteFont>("Fontopo"); dumbbellAnimation.Initialize(dumbbellSprite, new Vector2(600, 500), 200, 262, 12, 100, Color.White, 1f, true); base.LoadContent(); }
public override void LoadContent() { treadmillSprite = Content.Load <Texture2D>("Sprites/Run"); background = Content.Load <Texture2D>("Textures//Gym-Interior"); treadmill = Content.Load <Texture2D>("Textures//Treadmill-Side"); avatar = Content.Load <Texture2D>("Textures/avatar"); bubbleBox = Content.Load <Texture2D>("Textures/RunBubble"); font = Content.Load <SpriteFont>("Fontopo"); treadmillAnimation.Initialize(treadmillSprite, new Vector2(600, 500), treadmillSprite.Height, treadmillSprite.Height, treadmillSprite.Width / treadmillSprite.Height, 50, Color.White, 1f, true); base.LoadContent(); }
public void InitObjects() { me.Initialize(); }