GithubHelp home page GithubHelp logo

storyboard-projects's Introduction

storyboard-projects

storyboard-projects's People

Contributors

perryliao avatar

storyboard-projects's Issues

Duet: Sinwave movement

Configurables

  • int numSprites
  • double size
  • double timestep // decrease timestep to move faster
  • double startTime
  • double endTime

max range for varying is size/10

for (int i = 0; i < numSprites; i++) {
    // y = size * (sin( (x + varyingX) / size)) + varyingY;
    double varyingX = Random(size)/10 - size/20;
    double varyingY = Random(size)/10 - size/20;

    float x = Random(-107, 747);
    float y = size * (Math.Sin( (x + varyingX) / size)) + varyingY;
    OsbSprite circ = layer.CreateSprite("sb/cir.png", OsbOrigin.Centre, new Vector2(x, y)); 
    circ.Scale(startTime, 0.5);
    circ.Color(startTime, /* white */);
    circ.Fade(startTime, startTime + timeStep, 0, 1);

    for (double j = startTime; j < endTime - timeStep; j += timeStep) {
        x += size/10;
        y = size * (Math.Sin( (x + varyingX) / size)) + varyingY;
        circ.Move(j, j + timeStep, circ.PositionAt(j), x, y);
    }
    circ.Fade(endTime - timeStep, endTime, 1, 0);
}

Duet: Transition intro

[Configurable]
public double numBars  = 3;
[Configurable]
public double startTime = 0;
[Configurable]
public double timeStep = Constants.beatLength / 4;
[Configurable]
public Color4 barColour = Colours.beige;

double height = Constants.height / numBars;
double endTime = startTime + numBars * timeStep;

int i;
OsbSprite bar;
bool left;
for (i = 0; i < numBars; i++) {
    left = i % 2 == 0;
    bar = layer.CreateSprite("sb/1x1.jpg", left ? OsbOrigin.TopLeft : OsbOrigin.TopRight, new Vector2(left ? Constants.xFloor : Constants.xCeil, (float) (i * height)));

    bar.ScaleVec(startTime + i * timeStep, endTime, 0, height, Constants.width, height);
    bar.Color(startTime + i * timeStep, barColour);
}

Heart: Bar hotfix

bar doesn't start from the edge of the map, decreast the starting X coordinate.
image

Heart: Cube center of rotation is at origin

Apply the translation after rotation/scaling.

points[i] = Vector3.Add(Vector3.Multiply(points[i], width/2), new Vector3(x, y, 0));

Change to just the Scale, and change the parameters to moveEdge to include a x & y offset, so it can be added at

s.Move(i, i + timeStep, s.PositionAt(i), x, y);

To be s.Move(i, i + timeStep, s.PositionAt(i), x + xOffset, y + yOffset);

Duet: Transition Effect

Configurables:

  • double startTime
  • int numLines
// globals
double h = Math.Sqrt(Math.Sqr(854, 2) + Math.Sqr(480, 2)));
double w = h/numLines;
double theta = Math.Arctan(480/854);

for (int i = 0; i < numLines; i++) {
    Vector2 p = findPos(i);
    OsbSprite bar = layer.CreateSprite("sb/1x1.jpg", OsbOrigin.BottomCentre, p);
    double length = (p.X / Math.Cos(Math.PI)) + (p.Y / Math.Cos(Math.PI));

    bar.Rotate(startTime, -Math.PI/4);
    bar.ScaleVec(OsbEasing.OutExpo, startTime, startTime + beatLength/4, length, 0, length, w);
    bar.ScaleVec(OsbEasing.OutExpo, startTime + beatLength/4, startTime + beatLength/2, length, w, length, 0);
    bar.ScaleVec(OsbEasing.OutExpo, startTime + beatLength/2, startTime + beatLength*3/4, length, 0, length, w);
    bar.Move(OsbEasing.OutExpo, startTime + beatLength/2, startTime + beatLength*3/4, bar.PositionAt(startTime + beatLength/2), bar.PositionAt(startTime + beatLength/2).X + w*Math.Cos(theta), bar.PositionAt(startTime + beatLength/2).Y - w*Math.Sin(theta)));

    bar.Color(startTime, /*colour1*/); // blue
    bar.Color(startTime + beatLength/2, /*colour3*/); // white
}

OsbSprite tempBG = layer.CreateSprite("sb/1x1.jpg", OsbOrigin.Centre);
tempBG.ScaleVec(startTime + beatLength/4, 854, 480);
tempBG.Fade(startTime + beatLength/4, 1);
tempBG.Fade(startTime + beatLength/2, 0);
tempBG.Color(startTime + beatLength/4, /*colour2*/); // pink

/// <summary>Helper function for finding the centre of the transition bar</summary>
private Vector2 findPos(double index) {
    // find width of each line
    float x = (float) ((numLines - i) * w * Math.Cos(theta)); // right to left
    float y = (float) ((480/854)*(x + 107) + 480);
    return new Vector2(x, y);
}

Duet: Title effect

No configurables

// globals
double duration = beatLength * 3; // tentative 

/*
setTitle("sb/title/true", ...);
setTitle("sb/title/chihara", ...);
setTitle("sb/title/credit", ...);
setTitle("sb/title/title", ...);
*/

// set violet sprite here

private void setTitle(string path, double startTime) {
    OsbSprite title = layer.CreateSprite(path, OsbOrigin.Centre);
    title.Fade(startTime, 1);
    title.Fade(starTime + duration, 0);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.