GDevelop 5 beginner faq
#1 How can I deactivate keys or buttons?
We add a boolean-scene-variable and call it busy.
When we die, open a menu, etc. we can set the veribale to true.
If we add a condition to our control events now, the buttons are only executed if our variable is false.
#2 How can I save and load things?
In order to save high scores, unlocked levels, etc. locally, we need the storage actions.
The action "Write a value" saves the content of a variable.
After starting the game, we load the saved content into a scene-varibale.
If we need the value in several scenes, we write it from the scene-varibale to a global-varibale.
#3 How do I create a toggle button?
To create a toggle button or key, we need an additional boolean varibale.
So the second sub-event is not triggered if the first has been executed.
#4 How do I switch between scenes with buttons?
First we create a Sprite Object named sceneButtons and choose our button graphics as two animations.
Now we drag the button twice into our scene and change the Animation in the Properties Manager
to 1 for one of them.
We create a global variable with the name currentScene and the default value 1.
Then an mouse click event for our button and two sub-events with the object-variable
button, to check which button was pressed.
The action adds or subtracts a number for the scene name.
The second condition deactivates the button when we have reached the first or last scene.
Now we give our buttons variable the value left / right in the Properties Manager.
To change the scene, we add a third sub-event. We fill the scene-variable newScene with the name
we want to change to and use it in the Change the scene action.
With these two events we can hide one button when we are in the first or last scene.
External events
To avoid having to copy the code into each scene, we use an external event sheet.
We move the code from scene1 to the external sheet and add a link to it in scene1.
(Right Click » Add Other » Link)
External layout
We make our button available in every scene. (Right Click » Set as a global object)
Now we create an external layout, place our buttons in it and include this action in our
external events sheet at the beginning.
#5 How do I move an object from left to right?
We create a sprite object with the name directionChanger with the object-variable direction and add the
object twice to the scene.
Now we create a colision event with a toggle-boolean-scene-variable action and two events to
move our object.
#6 How do I detect the time during the game was closed?
Events are not executed when the game is not active, so we have to save and load the last time it was
open. Because users could close the game without using our exit button, we save the current time every
20 seconds.
When the game starts we check if a time has already been saved.
1. Read timeOld from the storage and and save it in the scene-variable timeOld.
2. Subtract timeOld from the current time and save it in timeOffline.
3. If we divide by 1000 and use round, we get the time that the app was closed in seconds.
4. We save the current time in storage.
#7 How do I notify desktop users about a game update?
We need a web space to save an availableVersion.txt with the latest version number.
Alternatively firebase Remote configuration or Firestore can be used.
After starting the game we define the current version number and load the latest one from our .txt
on the server.
We check if the available number is higher than the installed one and create a notification text and
download button. We don't use it as a sub-event because there is a little delay at loading from the server.
When the user clicks on the download button, the download is started or a download page is opened
in the browser.
#8 How do I create a cutscene?
First we deactivate the player input as explained in #1 when an event happens and our cutscene should
be started.
#9 How do I add a delay to actions?
We
my gdevelop games
my gdevelop extensions
IFrame
Offers an action to create, configure
and delete IFrames inside the game.
now available in the integrated extensions
Project properties
Allows to access Version number and
Author name from Project properties
with an expression. soon
Comments
Allows to add comments between
conditions/actions. Screenshot
my Feature requests & bug reports
New features
Read and generate QR codes
HTML5 export optionally packed as archive Screenshot
Calculate values in instance properties fields Screenshot
Use an own file extension for the project file instead of json
Use atlas-maps / sprite-sheets to significantly increase the loading speed of web games github link
Add WebUSB API to control an Arduino and build arcade machines, escape rooms, etc.
Add a folder tree to Object Manager [173]
Improvements
Add an "Inline" Object Effect
Add an option to set a default scene background color in Preferences
Add an empty animation to new created Sprite objects
Add an optional Z-order field in the Create an object action Screenshot
Add options for text-align, padding, border-radius, maxlength, autofocus to the Text input Object
Remove the "Cursor is on an object" condition for the Text input Object. doesn't work bc the outside rendering
Make the height of expression dropdown menu responsive, it is too low and scrolling skips entries Screenshot
Add possibly Tint color conditions for several object types
Add an action to delete a Collection from Cloud Firestore (if possible)
Show the Callback variable in the event-sheet for Create Acc and Sign in actions
Set Cloud firestore Write a field "Merge Document?" default YES
Reopen a scene after it was open and renamed
Add Flip horizontally/vertically in the instance properties
Remember the Behavior expanded/non-expanded status [173]
Add width/height/size action for the Text input Object
Static Add-object button like the search bar, so you don't have to scroll to find it [158]
Allow to on/off toggle the Panels (Object Groups, Layers, Instances list) [158]
Change the color of the minimized arrow in the event sheet, on dark themes. [140]
Allow to sort variables in the variable managers [133]
Add an "size" action for Sprite and Tiled Sprite that combines height and width in one action [129]
Add "NumpadReturn" to Key pressed/released condition
Add the colorpicker button to the color tweening action [118] Screenshot
Remember the sidebars width or use the minimum as default [93]
3D
3D navigation in the editor
Opacity
3D Text Object
Pointlights, Spotlights,..
Rename RotationYX actions/conditions to Angle, to match with the 2D/Z axis ones
hide/show doesn't work
Animation Speed
gd.games (Liluo)
Custom game window size
Option to not offer the fullscreen button
Option to set the order of the games
Allow scrolling in the game without scrolling the website (as it was made for arrows)
Pressing ALT key without triggering the browser shortcut when the game is active (as it was made for the space key)
Allow to change the background color that is visible when the game does not have the specified resolution/ratio.
It looks much better if it's not black but dark blue like everything else.
Bug fixes
Opening a second instance of GD, starts with default preferences, theme, language, ...
Edit a condition/action and select another object, the search searches for the previous object type
Opening a project starts in the last used asset folder path
When a variable is edited in the Properties panel for the first time, the text field loses focus after the first character
Adding a asset starts in the last opened project root directory
Since b111 created object-variables are not available in the dropdown menu [133]
Empty Animation field in the properties manager shows 6.71089e+07 instead of 0 Screenshot[127]
Created global & scene variables are not available in the dropdown before closing and reopening the action [106]
The mousewheel zoom in hitboxes and points, zooms in the wrong direction [102]
It drag and drops the wrong object into the scene if you use the search [76]
The game preview does not have 100% resolution/zoom [65]
Bad changes (Most of it can be easily fixed with adding a switch in Preferences)
Automatically open a not desired scene when a project is opened [139]
Highlight search results when searching for a condition/action [128]
It's absolutely unnecessary. It focuses on the word we typed, but that's not what we want to read in this case! In a few themes the contrast becomes very bad.
All categories in the project-manager are always open when a project is opened.
Save the collapsing status in the project or only open "Scenes". [152]
The Add buttons in project-manager are much more visible than category names, which is confusing. [152]
The Publish Button in the middle is far too visible that it is very rarely needed.
It should be a small button next to the project-manager button. There should be a “Launch another preview in a new window” button. [152]
Highlight entries in the variable editors [135]
Unnecessary and it doesn't work when you click in a text field. Most of the area of an entry is a text field, so most
of the time none or the wrong entry is highlighted. In some themes the text-selected-color is not visible due to highliting!
The font size in object and varibale manager has been reduced and is bad readable. [158]
Last update: 26. February 2024