public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Rectangle dstScreen = new Rectangle(0, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT); if (ZoomingStars.Count < MAX_STARS) ZoomingStars.Add(new Star(Element.Star)); for (int i = 0; i < ZoomingStars.Count; i++) if (ZoomingStars[i].Destroy) ZoomingStars.RemoveAt(i--); Game1.device.Clear(BGCOLOR); spriteBatch.Begin(); foreach (Star star in ZoomingStars) star.Draw(spriteBatch); FloatingWhale.Draw(spriteBatch); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; context.Clear (); context.Display (); }
protected RedirectToActionResult RedirectToAction(AController controller, String action) { RedirectToActionResult result = new(null, null, null); controller.RedirectToAction(action).Returns(result); return(result); }
public AController GetController() { if (m_Controller == null) { m_Controller = CreateController(); } return(m_Controller); }
protected RedirectToActionResult RedirectToAction(AController baseController, String action, String controller) { RedirectToActionResult result = new(null, null, null); baseController.RedirectToAction(action, controller).Returns(result); return(result); }
void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <AController>(); enemyHealth = GetComponent <AController>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); }
protected RedirectToActionResult RedirectToDefault(AController controller) { RedirectToActionResult result = new(null, null, null); controller.RedirectToDefault().Returns(result); return(result); }
public override void draw(SpriteBatch spriteBatch, AController controller) { base.draw(spriteBatch, controller); spriteBatch.Begin(); spriteBatch.DrawString(Game1.font, "Title Screen", title, Color.White); spriteBatch.DrawString(Game1.font, "Press any key to start", pressStart, Color.White); spriteBatch.End(); }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; foreach (Ball ball in c.Balls) ball.Draw(context); Text text = new Text("Title Screen"); context.Draw(text); }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Game1.device.Clear(BGColor); spriteBatch.Begin(); spriteBatch.Draw(SplashBackground, BGDstRect, Color.White); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public void Initialize(Transform rogueTransform, GameObject targetObj, AController inputController, float movementSpeed, float duration, float cooldown) { this.duration = duration; this.cooldown = cooldown; this.targetObject = targetObj; this.targetRigidbody = targetObj.GetComponent<Rigidbody>(); this.rogueTransform = rogueTransform; this.inputController = inputController; this.movementSpeed = movementSpeed; }
private void Start() { // Component Caching myRigidbody = GetComponent<Rigidbody>(); myTransform = GetComponent<Transform>(); PlayerNumber = 1; Team = legionTeamName; // Add Legion Camera inputController = ControllerManager.Instance.NewController(); }
public override void Draw( SpriteBatch spriteBatch, GameTime gameTime, AController controller) { base.Draw(spriteBatch, gameTime, controller); Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(Colour.PURPLE); spriteBatch.Begin(); spriteBatch.End(); }
public override void Draw( SpriteBatch spriteBatch, GameTime gameTime, AController controller) { base.Draw(spriteBatch, gameTime, controller); spriteBatch.Begin(); spriteBatch.Draw( Sprites.GetTexture(Element.Splash), new Rectangle(0, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT), Color.White); spriteBatch.End(); }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Game1.device.Clear(BG_COLOR); spriteBatch.Begin(); spriteBatch.DrawString(fontBold, currcredit, centre, Color.White); spriteBatch.DrawString(font, currname, namespot, Color.White); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(Colour.PINK); spriteBatch.Begin(); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public AController ReplaceController( AController currentController, AController newController ) { for(int i = 0; i < controllers.Length; i++) { if( controllers[i] == currentController ) { controllers[i] = newController; return controllers[i]; } } return null; }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; foreach (Ball ball in c.Balls) { ball.Draw(context); } Text text = new Text("Title Screen"); context.Draw(text); }
public void OnActionExecuting_SetsAuthorization() { controller = Substitute.ForPartsOf <AController>(); controller.ControllerContext.HttpContext = Substitute.For <HttpContext>(); controller.HttpContext.RequestServices.GetService(typeof(IAuthorization)).Returns(Substitute.For <IAuthorization>()); controller.OnActionExecuting(null); Object?expected = controller.HttpContext.RequestServices.GetRequiredService <IAuthorization>(); Object?actual = controller.Authorization; Assert.Same(expected, actual); }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(Colour.PINK); spriteBatch.Begin(); spriteBatch.Draw(BackgroundTexture, ScaleTextureDimension, Color.White); c.StartButton.Draw(spriteBatch); spriteBatch.End(); base.Draw(spriteBatch, controller); }
void Shoot() { gunAnimator.SetBool("shooting", true); // Reset the timer. timer = 0f; // Play the gun shot audioclip. gunAudio.Play(); // Enable the light. gunLight.enabled = true; // Stop the particles from playing if they were, then start the particles. gunParticles.Play(); // Enable the line renderer and set it's first position to be the end of the gun. gunLine.enabled = true; // Set the shootRay so that it starts at the end of the gun and points forward from the barrel. shootRay.origin = transform.position; shootRay.direction = transform.position + transform.forward * 1000; gunLine.SetPosition(0, bullet_spawn.transform.position); Debug.DrawLine(transform.position, transform.position + transform.forward * 10); // Perform the raycast against gameobjects on the shootable layer and if it hits something... if (Physics.Raycast(shootRay, out shootHit, range, shootableMask)) { // Try and find an EnemyHealth script on the gameobject hit. AController enemyHealth = shootHit.collider.GetComponentInParent <AController>(); // If the EnemyHealth component exist... if (enemyHealth != null) { // ... the enemy should take damage. enemyHealth.TakeDamage(damagePerShot, shootHit.point); } // Set the second position of the line renderer to the point the raycast hit. gunLine.SetPosition(1, shootHit.point); } // If the raycast didn't hit anything on the shootable layer... else { // ... set the second position of the line renderer to the fullest extent of the gun's range. gunLine.SetPosition(1, shootRay.origin + shootRay.direction * range); } }
bool IncreaseId(AController controller) { m_curId++; m_checkChange = true; if (m_curId >= m_sliderData.Points.Count) { /*if (CheckIfRepeat()) * { * controller.Move((int)m_curX, (int)m_curY); * } * else * return true;*/ } return(false); }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; context.Clear (); // foreach (Ball ball in c.Balls) // ball.Draw (context); // // Text text = new Text ("Title Screen"); // context.Draw (text); context.Draw(TitleScreen); context.Display (); }
public AControllerTests() { controller = Substitute.ForPartsOf <AController>(); controller.Url = Substitute.For <IUrlHelper>(); controller.ControllerContext.RouteData = new RouteData(); controller.TempData = Substitute.For <ITempDataDictionary>(); controller.Authorization.Returns(Substitute.For <IAuthorization>()); controller.ControllerContext.HttpContext = Substitute.For <HttpContext>(); controller.HttpContext.RequestServices.GetService(typeof(IAuthorization)).Returns(Substitute.For <IAuthorization>()); action = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor()); controllerName = (String)controller.RouteData.Values["controller"]; areaName = controller.RouteData.Values["area"] as String; }
void LateUpdate() { Character c = AController.ComponentUnderMouse <Character>(); if (c != lastMouseOver) { if (c) { EventOnMouseOver.Invoke(c); } else { EventLeaveMouseOver.Invoke(); } lastMouseOver = c; } }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(BackgroundColor); spriteBatch.Begin(); spriteBatch.Draw(Sprites.Blank, c.WhiteStripDst, WhiteStripColor); foreach (var item in c.Slots) item.Draw(spriteBatch); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public void AddController(AController c) { if (c is MapController) { mapController = (MapController)c; } else if (c is AudioController) { audioController = (AudioController)c; } else if (c is ScoreController) { scoreController = (ScoreController)c; } else if (c is UIController) { uiController = (UIController)c; } }
public override void draw(SpriteBatch spriteBatch, AController controller) { GameController c = (GameController)controller; base.draw(spriteBatch, controller); spriteBatch.Begin(); // Draw Map Grid int tileSize = GameController.TILE_SIZE; if (c.map != null) { for (int x = 0; x < c.map.mapNodes.GetLength(0); x++) { for (int y = 0; y < c.map.mapNodes.GetLength(1); y++) { int px = x * tileSize + 1; int py = y * tileSize + 1; int pw = tileSize - 2; int ph = tileSize - 2; // Draw Map Pathfinding.Node node = drawMap(spriteBatch, c, x, y, px, py, pw, ph); // Draw TEXT // drawText(spriteBatch, tileSize, px, py, node); } } } // Draw Units foreach (Unit u in c.units) u.Draw(spriteBatch); // Draw Selection if (c.dragging) spriteBatch.Draw(Sprites.blank, c.selectionRect, selectionColor); spriteBatch.DrawString(Game1.font, "GameView Screen", title, Color.White); spriteBatch.End(); }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; context.Clear (); if (SplashTitle != null) { float scaleX = 1; float scaleY = 1; scaleX = Game.Width / SplashTitle.GetLocalBounds ().Width; scaleY = Game.Height / SplashTitle.GetLocalBounds ().Height; SplashTitle.Scale = new Vector2f (scaleX, scaleY); context.Draw (SplashTitle); } context.Display (); }
// Update is called once per frame void Update() { // check mouseover character Character c = AController.ComponentUnderMouse <Character>(); if (c && c != user) { if (lastTarget != c) { lastTarget = c; attackPrognosis.gameObject.SetActive(true); attackPrognosis.Show(user, c); followTarget.Follow(c.transform); } } else { attackPrognosis.gameObject.SetActive(false); lastTarget = null; } }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(Color.White); spriteBatch.Begin(); spriteBatch.Draw(Sprites.Blank, BarStrip, StripColour); spriteBatch.Draw(Sprites.GetTexture(HeadingImagePath), BarText, Color.White); c.NextButton.Draw(spriteBatch); string largeWhale = "WhaleSelect/Whale_" + ((int)c.SelectedWhale).ToString("D2"); spriteBatch.Draw(Sprites.GetTexture(largeWhale), LargeWhaleDst, Color.White); foreach (var item in c.WhaleButtons) item.Draw(spriteBatch); spriteBatch.End(); base.Draw(spriteBatch, controller); }
private void UpdateCharacter() { // Update animation to match the motion UpdateAnimation(); // Now setup the rotation of the controller based on the direction we are travelling FVector playerVelocity = GetVelocity(); float travelDirection = playerVelocity.X; // Set the rotation so that the character faces his direction of travel. AController controller = GetController(); if (controller != null) { if (travelDirection < 0.0f) { controller.SetControlRotation(new FRotator(0.0f, 180.0f, 0.0f)); } else if (travelDirection > 0.0f) { controller.SetControlRotation(new FRotator(0.0f, 0.0f, 0.0f)); } } }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; context.Clear (); float scaleX = 1; float scaleY = 1; scaleX = Game.Width / TitleScreen.GetLocalBounds ().Width; scaleY = Game.Height / TitleScreen.GetLocalBounds ().Height; TitleScreen.Scale = new Vector2f (scaleX, scaleY); context.Draw (TitleScreen); if (++Time > Duration) { Time = 0; SwapTween (); } TitleWords.Scale = new Vector2f(scaleX, scaleY); context.Draw (TitleWords); float heartScale = Easing.Ease (Tween, Time, OriginScale, DestScale, Duration); Heart.Scale = new Vector2f (heartScale * scaleX, heartScale * scaleY); float w = Heart.TextureRect.Width * scaleX; float h = Heart.TextureRect.Height * scaleY; float x = 580 * scaleX; float y = 410 * scaleY; Heart.Position = new Vector2f (x + (w - w * heartScale) / 2, y + (h - h * heartScale) / 2); context.Draw (Heart); context.Display (); }
public override bool Act(AController controller, TimeSpan totalTime, TimeSpan elapsed, bool dTime) { const float spinSpeed = .049f; m_angle += spinSpeed * (float)elapsed.TotalMilliseconds; Vector2 point = controller.WindowHandle.Size(); point.x /= 3; point.y /= 3; point.x += (int)((float)Math.Cos(m_angle) * controller.WindowHandle.Size().x / 4); point.y += (int)((float)Math.Sin(m_angle) * controller.WindowHandle.Size().x / 4); if (m_init) { m_init = false; controller.Press(point.x, point.y); } controller.Move(point.x, point.y); if (totalTime.TotalMilliseconds >= m_spinData.EndTime) { controller.Release(point.x, point.y); return true; } return false; }
public override void Init(SongData songData, AController cont, TimeSpan totalTime, TimeSpan elapsed, bool doubletime) { base.Init(songData, cont, totalTime, elapsed, doubletime); m_song = songData; float msPBeat = -1; float multiplier = -1; if (m_song.Times.Count > 0) { if (msPBeat == -1 || multiplier == -1) { for (int i = m_song.Times.Count - 1; i >= 0; i--) { if (totalTime.TotalMilliseconds >= m_song.Times[i].Time) { if (m_song.Times[i].Multiplier != -1 && multiplier == -1) { multiplier = m_song.Times[i].Multiplier; } if (m_song.Times[i].MSPerBeat != -1 && msPBeat == -1) { msPBeat = m_song.Times[i].MSPerBeat; } } } } } m_millisecondsToComplete = ((float)(((float)m_sliderData.DataDistance / 100) * ((float)msPBeat / 1000)) / m_song.SliderMultiplier); m_millisecondsToComplete *= 1000; if (multiplier > 0) { m_millisecondsToComplete /= multiplier; } /* if (m_song.Times.Count > 0) { for (int i = m_song.Times.Count - 1; i >= 0; i--) { if (totalTime.TotalMilliseconds >= m_song.Times[i].Time) { m_millisecondsToComplete /= m_song.Times[i].Multiplier; break; } } }*/ if (doubletime) { m_millisecondsToComplete /= Program.DOUBLE_TIME_MULTIPLIER; } m_curX = 0; m_curY = 0; m_init = true; m_curId = 0; m_curRep = 1; m_totalElapsed = new TimeSpan(); }
bool IncreaseId(AController controller) { m_curId++; m_checkChange = true; if (m_curId >= m_sliderData.Points.Count) { /*if (CheckIfRepeat()) { controller.Move((int)m_curX, (int)m_curY); } else return true;*/ } return false; }
public AController GetController() { if (Controller == null) Controller = CreateController(); return Controller; }
public override void Draw(RenderWindow context, AController controller) { Controller c = (Controller)controller; }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; // Screen Shake //Counter += 0.1f; //Vector2 position = new Vector2(ShakeDepth * xAmplitude * (float)Math.Sin(Counter), //ShakeDepth * yAmplitude * (float)Math.Sin(Counter)); //if (ShakeDepth > 0.0f) // ShakeDepth -= 0.01f; //if (ShakeDepth <= 0.0f) // ShakeDepth = 0.0f; // Add all objects List<ActiveObject> drawableActiveObjects = new List<ActiveObject>(); List<ActiveObject> drawInFront = new List<ActiveObject>(); foreach (var item in c.ActiveObjects) { if (item.DrawInFront) drawInFront.Add(item); else drawableActiveObjects.Add(item); } drawableActiveObjects.Add(c.Player); Game1.device.SetRenderTarget(null); Game1.device.Clear(Colour.BLACK); float cameraX = Game1.SCREEN_WIDTH / 2 - c.Camera.Position.X; Matrix cameraTranslate = Matrix.CreateTranslation(cameraX, 0f, 0f); int posX = (int)(Math.Floor(c.Camera.Position.X / Game1.SCREEN_WIDTH) * Game1.SCREEN_WIDTH) - Game1.SCREEN_WIDTH / 2; spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, cameraTranslate); string planetBackgroundPath = "Planet/Planet_Green"; switch (c.Type) { case PlanetTypes.Green: planetBackgroundPath = "Planet/Planet_Green"; break; case PlanetTypes.Jungle: planetBackgroundPath = "Planet/Planet_Green"; // TODO Make Jungle planet break; case PlanetTypes.Desert: planetBackgroundPath = "Planet/Planet_Green"; // TODO Make Desert planet break; case PlanetTypes.Ice: planetBackgroundPath = "Planet/Planet_Ice"; break; case PlanetTypes.Volcano: planetBackgroundPath = "Planet/Planet_Volcano"; break; case PlanetTypes.Machine: planetBackgroundPath = "Planet/Planet_Machine"; break; } Rectangle bgDst = new Rectangle(posX, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT); Rectangle bgDst2 = new Rectangle(posX + Game1.SCREEN_WIDTH, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT); spriteBatch.Draw(Sprites.GetTexture(planetBackgroundPath), bgDst, Color.White); spriteBatch.Draw(Sprites.GetTexture(planetBackgroundPath), bgDst2, Color.White); c.WhaleButton.Draw(spriteBatch); foreach (var item in c.Foods) item.Draw(spriteBatch); foreach (var item in c.Critters) item.Draw(spriteBatch); foreach (var item in c.Cubes) item.Draw(spriteBatch); // Draw Ancient Machine foreach (var item in c.AncientMachines) item.Draw(spriteBatch); // Draw Move Cursor c.MoveCursor.Draw(spriteBatch); // Player and baddies foreach (var item in drawableActiveObjects) item.Draw(spriteBatch); foreach (var item in drawInFront) item.Draw(spriteBatch); // Draw People foreach (var item in c.Persons) item.Draw(spriteBatch); // Draws anything additional on top, like Yeti arms foreach (var item in c.ActiveObjects) if (item.DrawSomethingOnTop) item.DrawThisOnTop(spriteBatch); // Draw Effects foreach (var item in c.TeleportEffects) item.Draw(spriteBatch); // Explosion Effects for (int i = 0; i < c.Explosions.Count; i++) { if (c.Explosions[i].Destroy) c.Explosions.RemoveAt(i); else c.Explosions[i].Draw(spriteBatch); } spriteBatch.End(); base.Draw(spriteBatch, controller); }
public override void Draw(SpriteBatch spriteBatch, AController controller) { Controller c = (Controller)controller; Game1.device.SetRenderTarget(null); Game1.device.Clear(Color.Black); float cameraX = Game1.SCREEN_WIDTH / 2 - c.Camera.Position.X; Matrix cameraTranslate = Matrix.CreateTranslation(cameraX, 0f, 0f); int posX = (int)(Math.Floor(c.Camera.Position.X / Game1.SCREEN_WIDTH) * Game1.SCREEN_WIDTH) - Game1.SCREEN_WIDTH / 2; Rectangle dst = new Rectangle(posX, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT); Rectangle dst2 = new Rectangle(posX + Game1.SCREEN_WIDTH, 0, Game1.SCREEN_WIDTH, Game1.SCREEN_HEIGHT); spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, cameraTranslate); // Draw Background spriteBatch.Draw(Sprites.GetTexture("SolarSystem/BackgroundSpace"), dst, Color.White); spriteBatch.Draw(Sprites.GetTexture("SolarSystem/BackgroundSpace"), dst2, Color.White); // Draw Planets foreach (var item in c.Planets) if (Math.Abs(item.Dst.Center.X - c.Camera.Position.X) < (Game1.SCREEN_WIDTH + item.Dst.Width) / 2) item.Draw(spriteBatch); // Draw Teleport button c.ButtonTeleport.Draw(spriteBatch); // Draw Whale c.Whale.Draw(spriteBatch); // Draw Teleport button c.ButtonTeleport.Draw(spriteBatch); spriteBatch.End(); // Draw UI if (c.UIInventory.Visible) { spriteBatch.Begin(); c.UIInventory.Draw(spriteBatch); spriteBatch.End(); } if (c.UIWiki.Visible) { spriteBatch.Begin(); c.UIWiki.Draw(spriteBatch); spriteBatch.End(); } if (c.UISettings.Visible) { spriteBatch.Begin(); c.UISettings.Draw(spriteBatch); spriteBatch.End(); } if (!c.UIInventory.Visible && !c.UIWiki.Visible && !c.UISettings.Visible) { spriteBatch.Begin(); c.ButtonInventory.Draw(spriteBatch); c.ButtonWiki.Draw(spriteBatch); c.ButtonSettings.Draw(spriteBatch); spriteBatch.End(); } spriteBatch.Begin(); c.WhaleEnergy.Draw(spriteBatch); spriteBatch.End(); base.Draw(spriteBatch, controller); }
public override void Init(SongData songData, AController cont, TimeSpan totalTime, TimeSpan elapsed, bool doubletime) { base.Init(songData, cont, totalTime, elapsed, doubletime); m_song = songData; float msPBeat = -1; float multiplier = -1; if (m_song.Times.Count > 0) { if (msPBeat == -1 || multiplier == -1) { for (int i = m_song.Times.Count - 1; i >= 0; i--) { if (totalTime.TotalMilliseconds >= m_song.Times[i].Time) { if (m_song.Times[i].Multiplier != -1 && multiplier == -1) { multiplier = m_song.Times[i].Multiplier; } if (m_song.Times[i].MSPerBeat != -1 && msPBeat == -1) { msPBeat = m_song.Times[i].MSPerBeat; } } } } } m_millisecondsToComplete = ((float)(((float)m_sliderData.DataDistance / 100) * ((float)msPBeat / 1000)) / m_song.SliderMultiplier); m_millisecondsToComplete *= 1000; if (multiplier > 0) { m_millisecondsToComplete /= multiplier; } /* * if (m_song.Times.Count > 0) * { * for (int i = m_song.Times.Count - 1; i >= 0; i--) * { * if (totalTime.TotalMilliseconds >= m_song.Times[i].Time) * { * m_millisecondsToComplete /= m_song.Times[i].Multiplier; * break; * } * } * }*/ if (doubletime) { m_millisecondsToComplete /= Program.DOUBLE_TIME_MULTIPLIER; } m_curX = 0; m_curY = 0; m_init = true; m_curId = 0; m_curRep = 1; m_totalElapsed = new TimeSpan(); }
public virtual void Init(SongData songData, AController controller, TimeSpan totalTime, TimeSpan elapsed, bool doubletime) { HasBeenInit = true; }
protected ViewResult NotEmptyView(AController controller, Object model) { controller.NotEmptyView(model).Returns(new ViewResult()); return(controller.NotEmptyView(model)); }
public override bool Act(AController controller, TimeSpan totalTime, TimeSpan elapsed, bool dTime) { controller.Release(m_data.X, m_data.Y); controller.Click(m_data.X, m_data.Y); return(true); }
public override void Init(OsuBot.osu.SongData songData, AController cont, TimeSpan totalTime, TimeSpan elapsed, bool doubletime) { base.Init(songData, cont, totalTime, elapsed, doubletime); m_angle = 0; m_init = true; }
public override void Init(SongData songData, AController cont, TimeSpan totalTime, TimeSpan elapsed, bool doubletime) { base.Init(songData, cont, totalTime, elapsed, doubletime); }
private void Start() { animator = GetComponent<Animator>(); myRigidBody = GetComponent<Rigidbody>(); myTransform = GetComponent<Transform>(); inputController = ControllerManager.Instance.NewController(); score = 0; Team = rogueTeamName; // Temporary Change Until New Skills Are Added RogueBlink blink = gameObject.AddComponent<RogueBlink>(); blink.Initialize(GetComponent<Transform>(), globalCooldown, blinkDistance, blinkParticlePrefab); RogueClone clone = gameObject.AddComponent<RogueClone>(); clone.Initialize(myTransform, cloneObject, inputController, base.movementSpeed, cloneDuration, globalCooldown); RogueGlitch glitch = gameObject.AddComponent<RogueGlitch>(); glitch.Initialize(Camera.main.gameObject, lowerLimits, higherLimits, glitchDuration, glitchInterval, globalCooldown, minLengthPercentile, maxLengthPercentile); rogueSkills[0] = blink; rogueSkills[1] = clone; rogueSkills[2] = glitch; lightSource.intensity = maxIntensity; }
public override bool Act(AController controller, TimeSpan totalTime, TimeSpan elapsed, bool dTime) { if (m_init) { m_init = false; m_curX = m_sliderData.HitData.X; m_curY = m_sliderData.HitData.Y; controller.Press((int)m_curX, (int)m_curY); } m_totalElapsed += elapsed; //Console.WriteLine(m_curId + " " + m_sliderData.Points.Count + m_millisecondsToComplete); if (m_totalElapsed.TotalMilliseconds >= m_millisecondsToComplete + 10) { if (CheckIfRepeat() == false) { controller.Release((int)m_curX, (int)m_curY); return true; } else { if(m_sliderData.DataDistance >= MIN_SLIDER_DISTANCE) controller.Move((int)m_curX, (int)m_curY); } } else if(m_curId < m_sliderData.Points.Count) { WinAPI.POINT destination = new WinAPI.POINT(); float msPerPoint = m_millisecondsToComplete / ((float)m_sliderData.Points.Count - 1); destination = m_sliderData.Points[m_curId]; if (m_curId == 0) { m_curX = destination.x; m_curY = destination.y; controller.Move((int)m_curX, (int)m_curY); IncreaseId(controller); } else { float angleX = destination.x - m_curX; float angleY = destination.y - m_curY; float angle = (float)Math.Atan2(angleY, angleX); float addX = (float)Math.Cos(angle); float addY = (float)Math.Sin(angle); if (m_checkChange) { m_checkChange = false; m_checkX = true; m_checkY = true; if (m_curX < destination.x) { m_checkX = false; } if (m_curY < destination.y) { m_checkY = false; } } const float BRUTE_FORCE_SLOWDOWN = .94f; //Have no idea why I need to do this, but my shit goes too fast if (m_sliderData.Distance >= MIN_SLIDER_DISTANCE) { m_curX += addX * (((float)m_sliderData.Distance / m_millisecondsToComplete) * (float)elapsed.TotalMilliseconds) * BRUTE_FORCE_SLOWDOWN; m_curY += addY * (((float)m_sliderData.Distance / m_millisecondsToComplete) * (float)elapsed.TotalMilliseconds) * BRUTE_FORCE_SLOWDOWN; bool[] complete = new bool[2] { false, false }; if (!m_checkX) { if (m_curX >= destination.x) { complete[0] = true; } } else { if (m_curX <= destination.x) { complete[0] = true; } } if (!m_checkY) { if (m_curY >= destination.y) { complete[1] = true; } } else { if (m_curY <= destination.y) { complete[1] = true; } } if (complete[0] && complete[1]) { IncreaseId(controller); } } controller.Move((int)m_curX, (int)m_curY); } } return false; }
public override bool Act(AController controller, TimeSpan totalTime, TimeSpan elapsed, bool dTime) { if (m_init) { m_init = false; m_curX = m_sliderData.HitData.X; m_curY = m_sliderData.HitData.Y; controller.Press((int)m_curX, (int)m_curY); } m_totalElapsed += elapsed; //Console.WriteLine(m_curId + " " + m_sliderData.Points.Count + m_millisecondsToComplete); if (m_totalElapsed.TotalMilliseconds >= m_millisecondsToComplete + 10) { if (CheckIfRepeat() == false) { controller.Release((int)m_curX, (int)m_curY); return(true); } else { if (m_sliderData.DataDistance >= MIN_SLIDER_DISTANCE) { controller.Move((int)m_curX, (int)m_curY); } } } else if (m_curId < m_sliderData.Points.Count) { WinAPI.POINT destination = new WinAPI.POINT(); float msPerPoint = m_millisecondsToComplete / ((float)m_sliderData.Points.Count - 1); destination = m_sliderData.Points[m_curId]; if (m_curId == 0) { m_curX = destination.x; m_curY = destination.y; controller.Move((int)m_curX, (int)m_curY); IncreaseId(controller); } else { float angleX = destination.x - m_curX; float angleY = destination.y - m_curY; float angle = (float)Math.Atan2(angleY, angleX); float addX = (float)Math.Cos(angle); float addY = (float)Math.Sin(angle); if (m_checkChange) { m_checkChange = false; m_checkX = true; m_checkY = true; if (m_curX < destination.x) { m_checkX = false; } if (m_curY < destination.y) { m_checkY = false; } } const float BRUTE_FORCE_SLOWDOWN = .94f; //Have no idea why I need to do this, but my shit goes too fast if (m_sliderData.Distance >= MIN_SLIDER_DISTANCE) { m_curX += addX * (((float)m_sliderData.Distance / m_millisecondsToComplete) * (float)elapsed.TotalMilliseconds) * BRUTE_FORCE_SLOWDOWN; m_curY += addY * (((float)m_sliderData.Distance / m_millisecondsToComplete) * (float)elapsed.TotalMilliseconds) * BRUTE_FORCE_SLOWDOWN; bool[] complete = new bool[2] { false, false }; if (!m_checkX) { if (m_curX >= destination.x) { complete[0] = true; } } else { if (m_curX <= destination.x) { complete[0] = true; } } if (!m_checkY) { if (m_curY >= destination.y) { complete[1] = true; } } else { if (m_curY <= destination.y) { complete[1] = true; } } if (complete[0] && complete[1]) { IncreaseId(controller); } } controller.Move((int)m_curX, (int)m_curY); } } return(false); }
protected ViewResult NotFoundView(AController controller) { controller.NotFoundView().Returns(new ViewResult()); return(controller.NotFoundView()); }
public abstract bool Act(AController controller, TimeSpan totalTime, TimeSpan elapsed, bool doubletime);