public Overlay(Game g, RhythmGame rg, Texture2D t) { game = g; rhythmgame = rg; texture = t; Bounds.X = 0; Bounds.Y = 0; Bounds.Height = g.graphics.PreferredBackBufferHeight; Bounds.Width = g.graphics.PreferredBackBufferWidth; }
public override void StartSong(RhythmGame game, GameTime gameTime, SongDataPlus dataPlus, int instrument, float difficulty) { base.StartSong(game, gameTime, dataPlus, instrument, difficulty); Dictionary <string, Skill> skills = skillManager.Skills; foreach (KeyValuePair <string, Skill> pair in skills) { if (pair.Value.OnGoing) { skillManager.addOngoingSkill(pair.Key); } } }
public WidgetButton(Game g, RhythmGame rg, Texture2D tOff, Texture2D tOn, float x, float y, int width, int height, Keys key) { game = g; rhythmgame = rg; textureOff = tOff; textureOn = tOn; Bounds.X = x; Bounds.Y = y; Bounds.Width = width; Bounds.Height = height; buttonKey = key; }
// Use this for initialization void Start() { rhythmGame = FindObjectOfType <RhythmGame>(); }
void Awake() { instance = this; }
/// <summary> /// A single-tap, basic note. Starts just above the screen, and scrolls down toward the judgement line. /// </summary> /// <param name="g"> Game that is containing this note. </param> /// <param name="rg"> RhythmGame instance in which the note is placed. </param> /// <param name="t"> Texture to be used by the note. </param> /// <param name="b"> BPM at which this note will hit (used to calculate travel speed). </param> public Note(Game g, RhythmGame rg, Texture2D t, float b, UInt64 hf, int pos) { game = g; rhythmgame = rg; texture = t; hitframe = hf; Bounds.Width = 117; Bounds.Height = 30; Bounds.Y = 0 - Bounds.Height; // Place note at correct X-coordinate based on passed-in position flag switch (pos) { case 1: default: Bounds.X = 607; lane = 1; break; case 2: Bounds.X = 724; lane = 2; break; case 3: Bounds.X = 841; lane = 3; break; case 4: Bounds.X = 960; lane = 4; break; case 5: Bounds.X = 1077; lane = 5; break; case 6: Bounds.X = 1194; lane = 6; break; } bpm = b; notespeed = (bpm / 10.0f) * rhythmgame.multiplierNotespeed; yCoordStart = -30; yCoordHit = 880 - Convert.ToInt32(Bounds.Y) - rhythmgame.calibJudgementLine; yCoordTravel = yCoordHit - yCoordStart; // Find the frame at which to spawn the note, given travel speed, distance, and hit frame float frameSpawnOffset = yCoordTravel / notespeed; while (frameSpawnOffset > hitframe) { frameSpawnOffset /= 2; notespeed *= 2; } spawnframe = Convert.ToUInt64(hitframe - frameSpawnOffset); // Ensure spawn frame is greater than or equal to 0 if (spawnframe < 0) { spawnframe = 0; } active = false; }
void Start() { rhythmGame = GameObject.FindGameObjectWithTag("GameController").GetComponent<RhythmGame>(); score = rhythmGame.score; }