private static void torheartshatter(int time, int xpos, int ypos, int maxheight, double horspeed, double vspeed) { var shatter = new AnimationEvent("sb/torshatter.png", 4, 176); storyboard.AddSpriteEvent(shatter); shatter.Scale(time, 0.4f); if (horspeed > 0) { //Exit to the right shatter.MoveX(time, (int)(time + (2000 - xpos) / horspeed), None, xpos, 2000); } else { //Exit to the left shatter.MoveX(time, time + (int)(-1.0 * (2000 + xpos) / horspeed), None, xpos, -2000); } var delay = (ypos - maxheight) / vspeed; shatter.MoveY(time, (int)(time + delay), In, ypos, maxheight); shatter.MoveY((int)(time + delay), (int)(time + delay + delay), Out, maxheight, ypos); delay = time + delay + delay; //Now delay isn't a delay... var newvspeed = vspeed * 2; //Trying to get the maximum speed from easing, is this a parabola? //I'm not very good at stuff really. It might be 2x due to derived x squared... shatter.MoveY((int)delay, (int)(delay + (1200 - ypos) / newvspeed), None, ypos, 1200); }
private static void attackpellet(int time, int endtime, float xpos, float ypos) { var pellet = new AnimationEvent("sb/pel.png", 2, 100); storyboard.AddSpriteEvent(pellet); pellet.Scale(time, 0.4f); pellet.Fade(time, 1); pellet.Move(time, endtime, Out, new Position(xpos, ypos), new Position(320, 335)); pellet.Fade(endtime, 0); }
private static AnimationEvent newLetter(string letter, int spd, int time, int endtime, int xpos, int ypos, float fadval, int letter_othernumber, int intensity, int rainbow) { var ltr = new AnimationEvent(letter, letter_othernumber, spd, Background, BottomLeft); storyboard.AddSpriteEvent(ltr); formatletterfade(time, endtime, ltr, fadval); if (intensity != 0) { ltr.Scale(time, (float)(1 + intensity / 6.0)); spazletter(ltr, time, endtime, xpos, ypos, intensity); } else { ltr.Move(time, new Position(xpos, ypos)); } if (rainbow > 0) { var cur_rainbow = rainbow; const int cdelay = 150; var loopcount = (int)((endtime - time) / (cdelay * 6.0)); var finalstart = time + loopcount * cdelay * 6; byte clr1 = 255; byte clr2 = 255; byte clr3 = 255; byte clr4 = 255; byte clr5 = 255; byte clr6 = 255; var loop = ltr.CreateLoop(time, loopcount); for (var i = 0; i < 6; i++) { clr1 = 255; clr2 = 255; clr3 = 255; clr4 = 255; clr5 = 255; clr6 = 255; if (cur_rainbow == 1) { clr2 = 0; clr3 = 0; clr6 = 0; } else if (cur_rainbow == 2) { clr3 = 0; clr4 = 0; clr6 = 0; } else if (cur_rainbow == 3) { clr1 = 0; clr3 = 0; clr4 = 0; } else if (cur_rainbow == 4) { clr1 = 0; clr4 = 0; clr5 = 0; } else if (cur_rainbow == 5) { clr1 = 0; clr2 = 0; clr5 = 0; } else if (cur_rainbow == 6) { clr2 = 0; clr5 = 0; clr6 = 0; } loop.Color(i * cdelay, (i + 1) * cdelay, None, new Colour(clr1, clr2, clr3), new Colour(clr4, clr5, clr6)); cur_rainbow = cur_rainbow + 1; if (cur_rainbow == 7) { cur_rainbow = 1; } } ltr.Color(finalstart, endtime, None, new Colour(clr4, clr5, clr6), Colour.White); } return(ltr); }