FireMonkey allows you to create complex and sophisticated cross-platform applications. From business applications to games, there is something for everyone. Dozens of sample applications are available on the GetIt portal. Today we’ll look at the classic arcade game Mars Rocket. The player must collect points and land the rocket without crashing in this game. Three stars are randomly placed throughout the game screen on each level, which you can collect for more points. Delphi 10.4 added support for Apple’s Metal API on macOS, which is enabled in this game.
When you start discovering the building patterns in the game you can easily learn how to build similar games with Delphi FireMonkey. Moreover, you can learn more about mobile development and audio and animation tricks with FireMonkey.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
procedure TGameForm.PlayerHit; begin CreateExplosion(Ship.Position.X + (Ship.Width / 2), Ship.Position.Y + (Ship.Height / 2)); Ship.Visible := False; PlayerData.Lives := PlayerData.Lives - 1; PlayerData.SpeedX := 0; PlayerData.SpeedY := 0; PlayerData.VerticalVelocity := 0; PlayerData.HorizontalVelocity := 10; Ship.RotationAngle := 45; DisplayLives(PlayerData.Lives); if PlayerData.Lives > 0 then begin CenterPlayer; PlaySound(FAIL_SFX); end; end; procedure TGameForm.DisplayScore; begin ScoreLBL.Text := IntToStr(PlayerData.Score); end; procedure TGameForm.DelayedSettingsTimer(Sender: TObject); begin if (FileExists(DataFilePath + MUSIC_FILENAME) AND (MusicPlayer.Filename='')) then begin try MusicPlayer.Filename := DataFilePath + MUSIC_FILENAME; except on E: Exception do begin ShowMsgBox('Music failed to load: ' + E.Message); end; end; end; if HostEnabled = True then begin if NetworkConnected=True then begin ToggleAppTethering(True); end; end else begin ToggleAppTethering(False); end; DelayedSettings.Enabled := False; end; |
Be sure to head over and check out the Mars Rocket game on the GetIt portal and download it from the IDE!
Get the resources you need to know more about the Hockey Playview app developed by Jes-soft and find screenshots of the game in this article.
Learn how you can develop iOS;;App C++ with Windows 11 application development tools in the next article.
Do you want to build your own Multi-Platform Mars Rocket Game For Android, iOS, macOS, And Windows? Try the Multiple Platform App Development, which will assist you in developing apps in the Delphi or C++ environments.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition