From dd97441dc46eb52b124edf4e0a2ba6a650867e8e Mon Sep 17 00:00:00 2001 From: mogguh Date: Fri, 6 Apr 2007 17:41:55 +0000 Subject: Feature: Golden notes twinkle now when hit (Bug: if singing is stopped while note was hit (i.e. singer not singing loud enough), then twinkle will not be killed) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@70 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDraw.pas | 5 +++++ Game/Code/Classes/UGraphic.pas | 2 +- Game/Code/Classes/UGraphicClasses.pas | 41 ++++++++++++++++++++++++++++++++--- 3 files changed, 44 insertions(+), 4 deletions(-) (limited to 'Game/Code/Classes') diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas index e0e8e941..7447b6bf 100644 --- a/Game/Code/Classes/UDraw.pas +++ b/Game/Code/Classes/UDraw.pas @@ -425,6 +425,11 @@ var end; // with end; // for +// eigentlich brauchen wir hier einen vergleich, um festzustellen, ob wir mit +// singen schon weiter wären, als bei Rec.Right, _auch, wenn nicht gesungen wird_ + with Player[NrGracza].Nuta[N] do + if not (Start+Dlugosc-1 = Czas.AktBeatD) then + GoldenRec.GoldenNoteTwinkle(Rec.Top,Rec.Bottom,Rec.Right); end; // if end; diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas index 73bb1706..9f3e6667 100644 --- a/Game/Code/Classes/UGraphic.pas +++ b/Game/Code/Classes/UGraphic.pas @@ -191,7 +191,7 @@ begin end; Tex_Note_Perfect_Star := Texture.LoadTexture(pchar(Skin.GetTextureFileName('NotePerfectStar')), 'JPG', 'Font Black', 0); - Tex_Note_Star := Texture.LoadTexture(pchar(Skin.GetTextureFileName('NoteStar')), 'JPG', 'Font Black', 0); + Tex_Note_Star := Texture.LoadTexture(pchar(Skin.GetTextureFileName('NoteStar')) , 'JPG', 'Alpha Black Colored', $FFFFFF); Tex_Ball := Texture.LoadTexture(pchar(Skin.GetTextureFileName('Ball')), 'BMP', 'Transparent', $FF00FF); diff --git a/Game/Code/Classes/UGraphicClasses.pas b/Game/Code/Classes/UGraphicClasses.pas index d5eb44ab..66264334 100644 --- a/Game/Code/Classes/UGraphicClasses.pas +++ b/Game/Code/Classes/UGraphicClasses.pas @@ -30,6 +30,7 @@ type LastTime : Cardinal; RecArray : Array of RectanglePositions; PerfNoteArray : Array of PerfectNotePositions; + DelayAfterKillall : Integer; constructor Create; procedure Draw; @@ -39,6 +40,7 @@ type procedure KillAll(); procedure SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real); procedure SavePerfectNotePos(Xtop, Ytop: Real); + procedure GoldenNoteTwinkle(Top,Bottom,Right: Real); end; var GoldenRec : TEffectManager; @@ -64,27 +66,36 @@ var W, H: real; Alpha : real; begin - Alpha := (-cos((Frame+1)*2*pi/16)+1); //Fade Eyecandy + //Fade Eyecandy Case StarType of 1: begin + Alpha := (-cos((Frame+1)*2*pi/16)+1); W := 20; H := 20; glColor4f(0.99, 1, 0.6, Alpha); end; 2: begin + Alpha := (-cos((Frame+1)*2*pi/16)+1); W := 30; H := 30; glColor4f(1, 1, 0.95, Alpha); end; + 3: + begin + Alpha := (Live/3); + W := 15; + H := 15; + glColor4f(1, 1, 0.9, Alpha); + end; end; + glBindTexture(GL_TEXTURE_2D, Tex); glEnable(GL_TEXTURE_2D); - glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glBindTexture(GL_TEXTURE_2D, Tex); + glEnable(GL_BLEND); begin glBegin(GL_QUADS); @@ -211,6 +222,30 @@ begin SetLength(PerfNoteArray,0); end; +procedure TeffectManager.GoldenNoteTwinkle(Top,Bottom,Right: Real); +//Twinkle stars while golden note hit +var + C, P, XKatze, YKatze: Integer; +begin + DelayAfterKillall:=10; // To be used later, for the screen change issue + For P := 0 to high(RecArray) do // Are we inside a GoldenNoteRectangle? + begin + if ((RecArray[P].xBottom >= Right) and + (RecArray[P].xTop <= Right) and + (RecArray[P].yTop <= (Top+Bottom)/2) and + (RecArray[P].yBottom >= (Top+Bottom)/2)) then + begin + for C := 1 to 8 do + begin + Ykatze := RandomRange(ceil(Top) , ceil(Bottom)); + XKatze := RandomRange(-7,3); + Spawn(Ceil(Right)+XKatze, YKatze, Tex_Note_Star.TexNum, 3, 0, -1, 3); + end; + exit; // found a GoldenRec, did spawning stuff... done + end; + end; +end; + procedure TEffectManager.SaveGoldenStarsRec(Xtop, Ytop, Xbottom, Ybottom: Real); var P : Integer; // P like used in Positions -- cgit v1.2.3