
procedure TfrmGame.CreateTextAnimation(i, j: Integer; Const aValue: string; aTextType: TTextType);
var
lText: TText;
lEffect: TGlowEffect;
lAni: TFloatAnimation;
begin
lText := TText.Create(nil);
lText.Parent := BoardLayout;
lText.Text := aValue;
lText.WordWrap := False;
lText.AutoSize := True;
lText.Position.X := i * fCellWidth;
lText.Position.Y := j * fCellHeight;
lText.HitTest := False;
lText.Font.Style := [TFontStyle.fsBold];
lText.BringToFront;
lEffect := TGlowEffect.Create(lText);
lEffect.Parent := lText;
lAni := TFloatAnimation.Create(lText);
lAni.Parent := lText;
lAni.PropertyName := 'Position.Y';
lAni.StartValue := lText.Position.Y;
lAni.StopValue := lAni.StartValue - fCellHeight;
lAni.OnFinish := DoTextFinish;
case aTextType of
ttScore:
begin
lText.Font.Size := 15;
lText.Color := TAlphaColorRec.White;
lEffect.GlowColor := TAlphaColorRec.Black;
lEffect.Softness := 0;
lAni.Duration := 2;
end;
ttMultiplier:
begin
lText.Font.Size := 30;
lText.Color := TAlphaColorRec.Magenta;
lEffect.GlowColor := TAlphaColorRec.Black;
lEffect.Softness := 0;
lAni.Duration := 4;
lText.BringToFront;
end;
end;
lAni.Start;
end;
Head over and download the full source code of the Bejeweled clone in Delphi XE6 Firemonkey.
Wow! I would love to try this out this weekend 🙂
Not found “Hall.txt”.
That’s where it stores it’s high scores I believe. Maybe just create a text file named that? I was able to run it under AppMethod (though I don’t think it looked correct) and didn’t see that error but I didn’t pass the first level either.
Hi,
Awesome work 🙂
I’ve tested on ios 7.1 and it crashes loading the app, this on a iphone 5, but it runs ok in the iphone emulator, any clue on this?
On my s3 it runs just fine!
I’ll try to test it on IOS soon. In the mean time you can debug the problem with:
http://www.fmxexpress.com/use-the-iphone-configuration-utility-and-nslog-to-debug-delphi-xe5-firemonkey-apps-for-ios/
Hello
So, Can you create a class to simplify code reuse?
Thanks