SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Easy coding a multi-device
game with FireMonkey
Patrick Prémartin
Twitter : @premartinpatric
Email : patrick.premartin@olfsoft.com
www.embarcaderoacademy.com/p/coderage-2018
Agenda
• Introduction
• Setting the project
• Creating sprites and buttons
• Creating the screens
• Do some (simple) code
• Testing on devices
• Conclusion
• Q&A
Introduction
What is FireMonkey ?
• FireMonkey (FMX) is a multi-device framework based on graphic
libraries.
• The same program can be compiled for iOS, Android, macOS and
Windows.
• FireMonkey has RAD capabilities.
It’s simple to use, simple to understand and simple to learn.
• And of course it’s included for free in RAD Studio, Delphi and
C++Builder even in the free Community Edition.
What sort of games can we create ?
• FireMonkey includes 2D and 3D components, Box2D and libraries
usually used by game creators.
• With no programming skills you can create simple games like today.
• With programming skills you can do what ever you want and benefit
from multi-device FMX capabilities.
What will we do today ?
• For Halloween I’ve created the game Pumpkin Killer available on
https://pumpkinkiller.gamolf.fr and the app stores.
• Today we’ll create a game for Christmas based on the same idea :
=> objects move on the screen
=> the player have to touch some of them
• We’ll start the game with 3 lives and no score.
It will end after the lost of last life.
• You can download this game project and use it as a template :
https://vasur.fr/coderage2018src
Setting the project
Setting the project
• Design your game on paper
• Choose, buy or create your assets (images, sounds, musics) :
• title and background image for your game
• an app icon for Windows, macOS, iOS and Android
• a splash screen for iOS and Android
• user interface buttons, sprites and other elements
• Arrange them in a folder tree
• Add a text to remember what you can do with each file and where
they come from.
Setting the project
• Open Delphi or C++Builder
• Create a new multi-device blank application
• Put your icons in “Project / Options / Application / Icons”
• Fill the “Project / Options / Application / Version Info” forms
• Save the project
Creating sprites and buttons
Creating sprites and buttons
• Creating a button component
Creating sprites and buttons
• Creating a button component
• Creating the sprite base
Creating sprites and buttons
• Creating a button component
• Creating the sprite base
• Creating the “good” sprite
Creating sprites and buttons
• Creating a button component
• Creating the sprite base
• Creating the “good” sprite
• Creating the ”bad” sprite
Creating the screens
Creating the screens
• For a simple game we need 6 screens : home, game, game over, hall
of fame, options and credits.
Creating the screens
• For a simple game we need 6 screens : home, game, game over, hall
of fame, options and credits.
• The simple way is to use a TLayout for each screen on the same
TForm.
• The background of the game will be the background bitmap on the
TForm. It can stretch to the good size.
• In our game we put the title image on the TForm.
If you prefer you can put it on some TLayout or change it’s visible
property depending on the screen displayed.
Do some (simple) code
Do some (simple) code
• The first thing to do is to add link between the screens. We use
onClick event on the buttons.
Do some (simple) code
• The first thing to do is to add link between the screens. We use
onClick event on the buttons.
• On Android we need to intercept the “back” button of the phone or
tablet. We use onKeyDown event on the TForm.
For Windows and Mac we intercept the ESC key in the same event.
Do some (simple) code
• The first thing to do is to add link between the screens. We use
onClick event on the buttons.
• On Android we need to intercept the “back” button of the phone or
tablet. We use onKeyDown event on the TForm.
For Windows and Mac we intercept the ESC key in the same event.
• To store and display the scores we add a TDataModule unit with
some properties and a TFDMemTable.
We add a link between it and the Hall of Fame screen with Live
Bindings.
Do some (simple) code
• Now we can animate the sprites :
• Initialize their properties on create
• Fill the onClick event (increase score, decrease life, enable the animation)
• Move the sprites and test when they exit the screen
Do some (simple) code
• Now we can animate the sprites :
• Initialize their properties on create
• Fill the onClick event (increase score, decrease life, enable the animation)
• Move the sprites and test when they exit the screen
• Working on the game screen :
• Initialize the game properties
• Add the code needed when the score changes
• Add the code needed when the number of lifes changes
• Add the game loop (add, kill and move the sprites)
Do some (simple) code
• And we finish with the game over screen :
• Store the score if the user wants it
• Display the hall of fame
Testing on devices
Testing on devices
• Compile and run the game on Windows
Testing on devices
• Compile and run the game on Windows
• Compile and run the game on Android
Testing on devices
• Compile and run the game on Windows
• Compile and run the game on Android
• Compile and run the game on macOS
Testing on devices
• Compile and run the game on Windows
• Compile and run the game on Android
• Compile and run the game on macOS
• Compile and run the game on iOS
Conclusion
Conclusion
• Now you have a simple game template you can modify as you want.
• As you can see FireMonkey is a simple framework to play with. J
• We are waiting for your games…
Recap
• Introduction
• Setting the project
• Creating sprites and buttons
• Creating the screens
• Do some (simple) code
• Testing on devices
• Conclusion
• Q&A
• Patrick Prémartin
Twitter : @premartinpatric
patrick.premartin@olfsoft.com
• My blog :
https://developpeur-pascal.fr
• Download this project on:
https://vasur.fr/coderage2018src
www.embarcaderoacademy.com/p/coderage-2018

Más contenido relacionado

Similar a Easy coding a multi device game with FireMonkey

Deploy All The Games
Deploy All The GamesDeploy All The Games
Deploy All The GamesAdam Hill
 
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...SanaChoudary
 
Creating great Unity games for Windows 10 - Part 1
Creating great Unity games for Windows 10 - Part 1Creating great Unity games for Windows 10 - Part 1
Creating great Unity games for Windows 10 - Part 1Jiri Danihelka
 
Brass Monkey Couch Multiplayer
Brass Monkey Couch MultiplayerBrass Monkey Couch Multiplayer
Brass Monkey Couch MultiplayerFrancois Laberge
 
Absolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devAbsolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devBarry Ezell
 
Cmd unity withc
Cmd unity withcCmd unity withc
Cmd unity withcumairnoora
 
Let's make a game unity
Let's make a game   unityLet's make a game   unity
Let's make a game unitySaija Ketola
 
Python games
Python gamesPython games
Python gamesdxbeeh
 
An Introduction to Unity
An Introduction to UnityAn Introduction to Unity
An Introduction to Unityfesuffolk
 
Kodu Together: Video Game Programming & Publishing
Kodu Together: Video Game Programming & PublishingKodu Together: Video Game Programming & Publishing
Kodu Together: Video Game Programming & PublishingNick Tanzi
 
Project presentation
Project presentationProject presentation
Project presentationHarsh Sharma
 
Making A Game Engine Is Easier Than You Think
Making A Game Engine Is Easier Than You ThinkMaking A Game Engine Is Easier Than You Think
Making A Game Engine Is Easier Than You ThinkGorm Lai
 
Video game development for everybody
Video game development for everybodyVideo game development for everybody
Video game development for everybodySarah Sexton
 
Developing games for consoles as an indie in 2019
Developing games for consoles as an indie in 2019Developing games for consoles as an indie in 2019
Developing games for consoles as an indie in 2019David Voyles
 

Similar a Easy coding a multi device game with FireMonkey (20)

Deploy All The Games
Deploy All The GamesDeploy All The Games
Deploy All The Games
 
Presentación Unity
Presentación UnityPresentación Unity
Presentación Unity
 
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
Road to Success (July 1st) - Mobile Game Development Alternatives - Andrew Bu...
 
Unity 3 d
Unity 3 dUnity 3 d
Unity 3 d
 
Creating great Unity games for Windows 10 - Part 1
Creating great Unity games for Windows 10 - Part 1Creating great Unity games for Windows 10 - Part 1
Creating great Unity games for Windows 10 - Part 1
 
Brass Monkey Couch Multiplayer
Brass Monkey Couch MultiplayerBrass Monkey Couch Multiplayer
Brass Monkey Couch Multiplayer
 
Windows 7
Windows 7Windows 7
Windows 7
 
Absolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone devAbsolute Beginners Guide to iPhone dev
Absolute Beginners Guide to iPhone dev
 
Cmd unity withc
Cmd unity withcCmd unity withc
Cmd unity withc
 
Let's make a game unity
Let's make a game   unityLet's make a game   unity
Let's make a game unity
 
Python games
Python gamesPython games
Python games
 
An Introduction to Unity
An Introduction to UnityAn Introduction to Unity
An Introduction to Unity
 
Kodu Together: Video Game Programming & Publishing
Kodu Together: Video Game Programming & PublishingKodu Together: Video Game Programming & Publishing
Kodu Together: Video Game Programming & Publishing
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
 
Project presentation
Project presentationProject presentation
Project presentation
 
Making A Game Engine Is Easier Than You Think
Making A Game Engine Is Easier Than You ThinkMaking A Game Engine Is Easier Than You Think
Making A Game Engine Is Easier Than You Think
 
Unity 3d Basics
Unity 3d BasicsUnity 3d Basics
Unity 3d Basics
 
ICS3211 lecture 08
ICS3211 lecture 08ICS3211 lecture 08
ICS3211 lecture 08
 
Video game development for everybody
Video game development for everybodyVideo game development for everybody
Video game development for everybody
 
Developing games for consoles as an indie in 2019
Developing games for consoles as an indie in 2019Developing games for consoles as an indie in 2019
Developing games for consoles as an indie in 2019
 

Más de pprem

Using FireMonkey as a game engine
Using FireMonkey as a game engineUsing FireMonkey as a game engine
Using FireMonkey as a game enginepprem
 
Using Delphi as a no code development environment
Using Delphi as a no code development environmentUsing Delphi as a no code development environment
Using Delphi as a no code development environmentpprem
 
Utiliser FireMonkey comme moteur de jeux vidéo
Utiliser FireMonkey comme moteur de jeux vidéoUtiliser FireMonkey comme moteur de jeux vidéo
Utiliser FireMonkey comme moteur de jeux vidéopprem
 
Coder sans coder : Delphi en mode no code !
Coder sans coder : Delphi en mode no code !Coder sans coder : Delphi en mode no code !
Coder sans coder : Delphi en mode no code !pprem
 
Quoi de neuf dans la version 11 Alexandria ?
Quoi de neuf dans la version 11 Alexandria ?Quoi de neuf dans la version 11 Alexandria ?
Quoi de neuf dans la version 11 Alexandria ?pprem
 
Faire des applications web avec Delphi
Faire des applications web avec DelphiFaire des applications web avec Delphi
Faire des applications web avec Delphipprem
 
Utilisation de git avec Delphi
Utilisation de git avec DelphiUtilisation de git avec Delphi
Utilisation de git avec Delphipprem
 
Diffuser nos logiciels et leurs mises à jour
Diffuser nos logiciels et leurs mises à jourDiffuser nos logiciels et leurs mises à jour
Diffuser nos logiciels et leurs mises à jourpprem
 
Delphi et les tests unitaires
Delphi et les tests unitairesDelphi et les tests unitaires
Delphi et les tests unitairespprem
 
Développer une application pour Android TV avec Delphi
Développer une application pour Android TV avec DelphiDévelopper une application pour Android TV avec Delphi
Développer une application pour Android TV avec Delphipprem
 
Sauvegarder et restaurer l'état des applications mobiles
Sauvegarder et restaurer l'état des applications mobilesSauvegarder et restaurer l'état des applications mobiles
Sauvegarder et restaurer l'état des applications mobilespprem
 
Gérer le clavier virtuel sous iOS et Android
Gérer le clavier virtuel sous iOS et AndroidGérer le clavier virtuel sous iOS et Android
Gérer le clavier virtuel sous iOS et Androidpprem
 
Internationaliser les projets VCL / FMX
Internationaliser les projets VCL / FMXInternationaliser les projets VCL / FMX
Internationaliser les projets VCL / FMXpprem
 
Comment développer pour Linux avec Delphi
Comment développer pour Linux avec DelphiComment développer pour Linux avec Delphi
Comment développer pour Linux avec Delphipprem
 
Utiliser des dessins vectoriels à la place d'images
Utiliser des dessins vectoriels à la place d'imagesUtiliser des dessins vectoriels à la place d'images
Utiliser des dessins vectoriels à la place d'imagespprem
 
Embarquer une base de données locale dans vos logiciels et applications mobiles
Embarquer une base de données locale dans vos logiciels et applications mobilesEmbarquer une base de données locale dans vos logiciels et applications mobiles
Embarquer une base de données locale dans vos logiciels et applications mobilespprem
 
Déploiement et débogage à distance
Déploiement et débogage à distanceDéploiement et débogage à distance
Déploiement et débogage à distancepprem
 
Utiliser l'EDI pour développer en multiplateforme
Utiliser l'EDI pour développer en multiplateformeUtiliser l'EDI pour développer en multiplateforme
Utiliser l'EDI pour développer en multiplateformepprem
 
Faire une interface adaptive avec la VCL
Faire une interface adaptive avec la VCLFaire une interface adaptive avec la VCL
Faire une interface adaptive avec la VCLpprem
 
Faire une interface adaptive avec FireMonkey
Faire une interface adaptive avec FireMonkeyFaire une interface adaptive avec FireMonkey
Faire une interface adaptive avec FireMonkeypprem
 

Más de pprem (20)

Using FireMonkey as a game engine
Using FireMonkey as a game engineUsing FireMonkey as a game engine
Using FireMonkey as a game engine
 
Using Delphi as a no code development environment
Using Delphi as a no code development environmentUsing Delphi as a no code development environment
Using Delphi as a no code development environment
 
Utiliser FireMonkey comme moteur de jeux vidéo
Utiliser FireMonkey comme moteur de jeux vidéoUtiliser FireMonkey comme moteur de jeux vidéo
Utiliser FireMonkey comme moteur de jeux vidéo
 
Coder sans coder : Delphi en mode no code !
Coder sans coder : Delphi en mode no code !Coder sans coder : Delphi en mode no code !
Coder sans coder : Delphi en mode no code !
 
Quoi de neuf dans la version 11 Alexandria ?
Quoi de neuf dans la version 11 Alexandria ?Quoi de neuf dans la version 11 Alexandria ?
Quoi de neuf dans la version 11 Alexandria ?
 
Faire des applications web avec Delphi
Faire des applications web avec DelphiFaire des applications web avec Delphi
Faire des applications web avec Delphi
 
Utilisation de git avec Delphi
Utilisation de git avec DelphiUtilisation de git avec Delphi
Utilisation de git avec Delphi
 
Diffuser nos logiciels et leurs mises à jour
Diffuser nos logiciels et leurs mises à jourDiffuser nos logiciels et leurs mises à jour
Diffuser nos logiciels et leurs mises à jour
 
Delphi et les tests unitaires
Delphi et les tests unitairesDelphi et les tests unitaires
Delphi et les tests unitaires
 
Développer une application pour Android TV avec Delphi
Développer une application pour Android TV avec DelphiDévelopper une application pour Android TV avec Delphi
Développer une application pour Android TV avec Delphi
 
Sauvegarder et restaurer l'état des applications mobiles
Sauvegarder et restaurer l'état des applications mobilesSauvegarder et restaurer l'état des applications mobiles
Sauvegarder et restaurer l'état des applications mobiles
 
Gérer le clavier virtuel sous iOS et Android
Gérer le clavier virtuel sous iOS et AndroidGérer le clavier virtuel sous iOS et Android
Gérer le clavier virtuel sous iOS et Android
 
Internationaliser les projets VCL / FMX
Internationaliser les projets VCL / FMXInternationaliser les projets VCL / FMX
Internationaliser les projets VCL / FMX
 
Comment développer pour Linux avec Delphi
Comment développer pour Linux avec DelphiComment développer pour Linux avec Delphi
Comment développer pour Linux avec Delphi
 
Utiliser des dessins vectoriels à la place d'images
Utiliser des dessins vectoriels à la place d'imagesUtiliser des dessins vectoriels à la place d'images
Utiliser des dessins vectoriels à la place d'images
 
Embarquer une base de données locale dans vos logiciels et applications mobiles
Embarquer une base de données locale dans vos logiciels et applications mobilesEmbarquer une base de données locale dans vos logiciels et applications mobiles
Embarquer une base de données locale dans vos logiciels et applications mobiles
 
Déploiement et débogage à distance
Déploiement et débogage à distanceDéploiement et débogage à distance
Déploiement et débogage à distance
 
Utiliser l'EDI pour développer en multiplateforme
Utiliser l'EDI pour développer en multiplateformeUtiliser l'EDI pour développer en multiplateforme
Utiliser l'EDI pour développer en multiplateforme
 
Faire une interface adaptive avec la VCL
Faire une interface adaptive avec la VCLFaire une interface adaptive avec la VCL
Faire une interface adaptive avec la VCL
 
Faire une interface adaptive avec FireMonkey
Faire une interface adaptive avec FireMonkeyFaire une interface adaptive avec FireMonkey
Faire une interface adaptive avec FireMonkey
 

Último

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Último (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

Easy coding a multi device game with FireMonkey

  • 1. Easy coding a multi-device game with FireMonkey Patrick Prémartin Twitter : @premartinpatric Email : patrick.premartin@olfsoft.com www.embarcaderoacademy.com/p/coderage-2018
  • 2. Agenda • Introduction • Setting the project • Creating sprites and buttons • Creating the screens • Do some (simple) code • Testing on devices • Conclusion • Q&A
  • 4. What is FireMonkey ? • FireMonkey (FMX) is a multi-device framework based on graphic libraries. • The same program can be compiled for iOS, Android, macOS and Windows. • FireMonkey has RAD capabilities. It’s simple to use, simple to understand and simple to learn. • And of course it’s included for free in RAD Studio, Delphi and C++Builder even in the free Community Edition.
  • 5. What sort of games can we create ? • FireMonkey includes 2D and 3D components, Box2D and libraries usually used by game creators. • With no programming skills you can create simple games like today. • With programming skills you can do what ever you want and benefit from multi-device FMX capabilities.
  • 6. What will we do today ? • For Halloween I’ve created the game Pumpkin Killer available on https://pumpkinkiller.gamolf.fr and the app stores. • Today we’ll create a game for Christmas based on the same idea : => objects move on the screen => the player have to touch some of them • We’ll start the game with 3 lives and no score. It will end after the lost of last life. • You can download this game project and use it as a template : https://vasur.fr/coderage2018src
  • 8. Setting the project • Design your game on paper • Choose, buy or create your assets (images, sounds, musics) : • title and background image for your game • an app icon for Windows, macOS, iOS and Android • a splash screen for iOS and Android • user interface buttons, sprites and other elements • Arrange them in a folder tree • Add a text to remember what you can do with each file and where they come from.
  • 9. Setting the project • Open Delphi or C++Builder • Create a new multi-device blank application • Put your icons in “Project / Options / Application / Icons” • Fill the “Project / Options / Application / Version Info” forms • Save the project
  • 11. Creating sprites and buttons • Creating a button component
  • 12. Creating sprites and buttons • Creating a button component • Creating the sprite base
  • 13. Creating sprites and buttons • Creating a button component • Creating the sprite base • Creating the “good” sprite
  • 14. Creating sprites and buttons • Creating a button component • Creating the sprite base • Creating the “good” sprite • Creating the ”bad” sprite
  • 16. Creating the screens • For a simple game we need 6 screens : home, game, game over, hall of fame, options and credits.
  • 17. Creating the screens • For a simple game we need 6 screens : home, game, game over, hall of fame, options and credits. • The simple way is to use a TLayout for each screen on the same TForm. • The background of the game will be the background bitmap on the TForm. It can stretch to the good size. • In our game we put the title image on the TForm. If you prefer you can put it on some TLayout or change it’s visible property depending on the screen displayed.
  • 19. Do some (simple) code • The first thing to do is to add link between the screens. We use onClick event on the buttons.
  • 20. Do some (simple) code • The first thing to do is to add link between the screens. We use onClick event on the buttons. • On Android we need to intercept the “back” button of the phone or tablet. We use onKeyDown event on the TForm. For Windows and Mac we intercept the ESC key in the same event.
  • 21. Do some (simple) code • The first thing to do is to add link between the screens. We use onClick event on the buttons. • On Android we need to intercept the “back” button of the phone or tablet. We use onKeyDown event on the TForm. For Windows and Mac we intercept the ESC key in the same event. • To store and display the scores we add a TDataModule unit with some properties and a TFDMemTable. We add a link between it and the Hall of Fame screen with Live Bindings.
  • 22. Do some (simple) code • Now we can animate the sprites : • Initialize their properties on create • Fill the onClick event (increase score, decrease life, enable the animation) • Move the sprites and test when they exit the screen
  • 23. Do some (simple) code • Now we can animate the sprites : • Initialize their properties on create • Fill the onClick event (increase score, decrease life, enable the animation) • Move the sprites and test when they exit the screen • Working on the game screen : • Initialize the game properties • Add the code needed when the score changes • Add the code needed when the number of lifes changes • Add the game loop (add, kill and move the sprites)
  • 24. Do some (simple) code • And we finish with the game over screen : • Store the score if the user wants it • Display the hall of fame
  • 26. Testing on devices • Compile and run the game on Windows
  • 27. Testing on devices • Compile and run the game on Windows • Compile and run the game on Android
  • 28. Testing on devices • Compile and run the game on Windows • Compile and run the game on Android • Compile and run the game on macOS
  • 29. Testing on devices • Compile and run the game on Windows • Compile and run the game on Android • Compile and run the game on macOS • Compile and run the game on iOS
  • 31. Conclusion • Now you have a simple game template you can modify as you want. • As you can see FireMonkey is a simple framework to play with. J • We are waiting for your games…
  • 32. Recap • Introduction • Setting the project • Creating sprites and buttons • Creating the screens • Do some (simple) code • Testing on devices • Conclusion • Q&A
  • 33. • Patrick Prémartin Twitter : @premartinpatric patrick.premartin@olfsoft.com • My blog : https://developpeur-pascal.fr • Download this project on: https://vasur.fr/coderage2018src www.embarcaderoacademy.com/p/coderage-2018