public ModularSkeleton(Vector2 position) : base(position, "ModularSkeleton", "TestObject") { this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/RightArm"), new Vector2(-49, 6), new Vector2(41, 73), Color.White, "RightArm"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/TopRightArm"), new Vector2(-5, -20), new Vector2(73, 61), Color.White, "TopRightArm"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/TopRightLeg"), new Vector2(10, 40), new Vector2(48, 62), Color.White, "TopRightLeg"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/RightLeg"), new Vector2(8, 80), new Vector2(36, 74), Color.White, "RightLeg"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/Body"), new Vector2(20, -5), new Vector2(40, 72), Color.White, "Body"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/Head"), new Vector2(-15, -72), new Vector2(72, 73), Color.White, "Head"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/TopLeftLeg"), new Vector2(43, 48), new Vector2(46, 66), Color.White, "TopLeftLeg"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/LeftLeg"), new Vector2(43, 90), new Vector2(38, 73), Color.White, "LeftLeg"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/TopLeftArm"), new Vector2(35, -15), new Vector2(57, 39), Color.White, "TopLeftArm"); this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/Skeleton/LeftArm"), new Vector2(25, 22), new Vector2(60, 26), Color.White, "LeftArm"); this.rendererComponents.AddModularAnimationToComponent("Head", OrujinGame.GetModularAnimationByName("SkeletonHead")); this.rendererComponents.AddModularAnimationToComponent("Body", OrujinGame.GetModularAnimationByName("SkeletonBody")); this.rendererComponents.AddModularAnimationToComponent("TopLeftArm", OrujinGame.GetModularAnimationByName("TopLeftArm")); this.rendererComponents.AddModularAnimationToComponent("LeftArm", OrujinGame.GetModularAnimationByName("LeftArm")); this.rendererComponents.AddModularAnimationToComponent("TopRightArm", OrujinGame.GetModularAnimationByName("TopRightArm")); this.rendererComponents.AddModularAnimationToComponent("RightArm", OrujinGame.GetModularAnimationByName("RightArm")); this.rendererComponents.AddModularAnimationToComponent("TopRightLeg", OrujinGame.GetModularAnimationByName("TopRightLeg")); this.rendererComponents.AddModularAnimationToComponent("RightLeg", OrujinGame.GetModularAnimationByName("RightLeg")); this.rendererComponents.AddModularAnimationToComponent("TopLeftLeg", OrujinGame.GetModularAnimationByName("TopLeftLeg")); this.rendererComponents.AddModularAnimationToComponent("LeftLeg", OrujinGame.GetModularAnimationByName("LeftLeg")); GameManager.game.AddObject(this); }
/***Add objects here***/ public override void Start() { Tile tile1 = new Tile(OrujinGame.GetTexture2DByName("Textures/Level1"), new Vector2(1280 / 2, 720 / 2), new Vector2(0, 0), "Tile1", "Tile"); Player testPlayer = new Player(new Vector2(400, 500), "PlayerOne"); this.CreateCameraEventsAndBorders(testPlayer.identity); base.AddInputCommand("PlayerOne", "Jump", DynamicArray.ObjectArray(2.0f), Keys.Up, Buttons.A); base.AddInputCommand("PlayerOne", "MovePlayer", DynamicArray.ObjectArray(new Vector2(-10.0f, 0)), Keys.Left, Buttons.LeftThumbstickLeft); base.AddInputCommand("PlayerOne", "MovePlayer", DynamicArray.ObjectArray(new Vector2(10.0f, 0)), Keys.Right, Buttons.LeftThumbstickRight); base.AddInputCommand("Camera", "Scale", DynamicArray.ObjectArray(new Vector2(0.1f, 0.1f)), Keys.W, Buttons.X); base.AddInputCommand("Camera", "Scale", DynamicArray.ObjectArray(new Vector2(-0.1f, -0.1f)), Keys.S, Buttons.X); base.AddInputCommand("Camera", "MoveBy", DynamicArray.ObjectArray(new Vector2(-1280.0f, 0), 1000), Keys.A, Buttons.X); base.AddInputCommand("Camera", "SetParent", DynamicArray.ObjectArray(testPlayer), Keys.C, Buttons.X); base.AddInputCommand("Camera", "CenterParentContiniously", DynamicArray.ObjectArray(500), Keys.V, Buttons.X); base.AddInputCommand("Camera", "SetPosition", DynamicArray.ObjectArray(new Vector2(100, 100)), Keys.B, Buttons.X); //Load level once the game and the events have been set up. this.LoadLevel("Content/Levels/TheMeadowPart1FixedGrass.xml", new MyObjectProcessor()); base.Start(); }
public SpriteSkeleton(Vector2 position) : base(position, "SpriteSkeleton", "TestObject") { this.rendererComponents.AddSprite(OrujinGame.GetTexture2DByName("Textures/SkeletonSpriteSheet"), Vector2.Zero, null, Color.White, "SpriteAnimation"); this.rendererComponents.AddAnimationToComponent("SpriteAnimation", OrujinGame.GetSpriteAnimationByName("SkeletalSpriteAnimation")); GameManager.game.AddObject(this); }
public static Sprite CreateColoredRectangle(RendererComponents parent, Color color, float width, float height, Vector2 position, string name, int layer) { Sprite s = new Sprite(parent, OrujinGame.GetTexture2DByColor(color), position, new Vector2(1, 1), 0, color, layer, name, 1); s.SetOrigin(new Vector2(width / 2, height / 2)); s.rendererPackage.destination = new Rectangle(0, 0, (int)width, (int)height); return(s); }
public void DebugPlayMusic(string music) { OrujinGame.PlaySong(music, false); }