Welcome to GD Extensions
A place where I upload my GDevelop Extensions
EasyFullscreen
The “EasyFullscreen” extension for GDevelop simplifies the process of toggling between windowed and fullscreen modes in your game. Instead of manually coding the fullscreen functionality, this extension provides a single action that you can trigger with a key press.
Easy way to toggle Full screen in GDevelop
Key features and how it works:
__PARAM1__ represent the key you want to use to toggle fullscreen.
Toggling with a Key: You can specify a key (e.g., “F” by default, or any key you choose) that the player can press to switch between windowed and fullscreen modes.
Scene Variable: The extension uses a scene variable named __EasyFullscreen_fullscreen
(a boolean value) to keep track of whether the game is currently in fullscreen mode.
- If
__EasyFullscreen_fullscreen
istrue
, the game is in fullscreen.
- If
__EasyFullscreen_fullscreen
isfalse
, the game is in windowed mode.
How to Use:
- Import the “EasyFullscreen” extension into your GDevelop project.
- Use the “Go fullscreen with this key: _PARAM1_ or (default: f)” action in your events.
- __PARAM1__ represent the key you want to use to toggle fullscreen.
Streamlined way to save and load game data in GDevelop
FunctionaKey Features and How It Works:
Local Storage: The extension stores data in the browser’s local storage, allowing data to persist between game sessions.lity:
Simplified Saving and Loading: “EasySave” offers simple actions to save and load data without requiring manual variable creation or complex storage management.
Data Types: The extension supports saving and loading both strings (text) and numbers (numerical values).
EasySaveData Variable: The extension uses a scene variable named “EasySaveData” (a structure) to store loaded data. You can access the saved values using dot notation (e.g., EasySaveData.playerName
, EasySaveData.score
).
- Key Actions:
- Init: Initializes the EasySave manager. This should typically be called at the beginning of the scene.
- Load All: Loads all saved data from local storage and populates the “EasySaveData” scene variable.
- Delete: Deletes all saved data from local storage and clears the “EasySaveData” variable.
- SaveString: Saves a string value under a specified key (name).
- SaveNumber: Saves a numerical value under a specified key (name).
- LoadString: Loads a string value from local storage into the “EasySaveData” variable, associated with a specified key (name).
- LoadNumber: Loads a numerical value from local storage into the “EasySaveData” variable, associated with a specified key (name).
EasySave
The “EasySave” extension for GDevelop provides a user-friendly way to implement data saving and loading in your games. It abstracts away the complexities of managing variables and storage, allowing you to easily save and retrieve game data such as player progress, scores, settings, and more.
- Usage:
- Import the “EasySave” extension into your GDevelop project.
- Use the “Init” action at the start of your scene to initialize the system.
- Use the “SaveString” and “SaveNumber” actions to save data. Specify a name (key) for each value you want to save.
- Use the “LoadAll” action to load all saved data into the “EasySaveData” scene variable.
- Access the loaded data using
VariableString(EasySaveData.yourKey)
for strings andVariable(EasySaveData.yourKey)
for numbers. - Use the Delete Action to clear all data saved.
Fancy Score
The “FancyScore” extension for GDevelop is designed to enhance the presentation of scores in your games. It provides an easy way to format scores by allowing you to set a specific length and padding, making the scores look more visually appealing.
Straightforward way to format and display scores in GDevelop games
Simple and easy to use with shortcodes
Key Features and How It Works:
- Score Formatting: The extension allows you to convert scores like “Gold x 1” into formats like “Gold x 0001” by padding the numbers with leading zeros.
- Two Display Options:
- Text Object: Use a standard Text object to display the formatted score.
- Bitmap Text Object: Alternatively, use a Bitmap text object for a more stylized appearance.
- Setting Length: You can specify the total number of digits for the score. For example, if you set the length to 4, a score of 1 would be displayed as 0001.
- Usage:
- Import the Extension: Add the “FancyScore” extension to your GDevelop project.
- Use in Events: Utilize the provided actions in your event sheets to format scores. There are two actions available:
- Set score for this Text: This action formats the score for a standard Text object.
- Set score for this Bitmap Text: This action formats the score for a Bitmap text object.
Parameters Needed: - Text/BMF Text Object: Select the Text or Bitmap Text object where you want to display the score.
- Length: Specify the desired length for the score display.
- Score: Provide the score value that you wish to format.
- Example Usage: If you want to display a gold score of 10 with a length of 4, the text displayed will be “0010” (if using the default text).
Easy way to expose game properties in GDevelop
Get Properties Data
You can get the extension from GDevelop, just searh for GetPropertiesData inside GDevelop
Limit Drag & Drop extension
The Limit Drag & Drop extension is designed for game development purposes, particularly within environments that allow for drag-and-drop functionality. This extension enables developers to restrict the movement of draggable objects to either horizontal or vertical directions, enhancing control over object behavior during gameplay.
Actions Provided by the Extension:
- onCreated: This action is triggered when the object is created, storing its initial
X
andY
positions (StartX and StartY) for reference. - LimitHorizontal: When invoked, if the object is currently being dragged, this action sets the object’s
Y
position back to its originalStartY
, effectively locking its vertical movement. - LimitVertical: Similar to the horizontal limitation, this action resets the object’s
X
position back to its originalStartX
if dragged, restricting movement to vertical only. - doStepPostEvents: This action updates the object’s starting position variables (StartX and StartY) after the events have been processed, allowing for continuous tracking during movement.
Limit movement directions
Key Features:
- Limit Movement Directions: Developers can limit the movement of objects using this extension to only allow them to move on either the X-axis (horizontal) or the Y-axis (vertical), preventing diagonal dragging and thus simplifying the interaction for users.
- Behavior Integration: The extension requires the object to have a draggable behavior already applied. This ensures that the objects can be interacted with using drag-and-drop mechanics.
How to Use This Extension:
Limit to Move Only Vertically: This action will allow the object to move up and down, while its horizontal position remains constant.
Add Behavior: First, you need to attach the LimitDragAndDrop
behavior to any object that you want to restrict movement for.
Set Movement Limit: In your events, you can choose one of two actions to trigger:
Limit to Move Only Horizontally: This action will constrain the object to move left and right, while maintaining its vertical position fixed.
Practical Applications:
- Puzzle Games: Ideal for games where objects need to be aligned, such as puzzle games where pieces should be arranged in a certain order.
- UI Elements: Useful in user interface design where specific controls (like sliders or switches) should only move in one direction, enhancing usability.
- Constraints in Games: In gaming scenarios where physics constraints are important, such as keeping characters on a platform or restricting enemies to move within certain bounds.
Create and manage your customers and invoices
Key Functionalities
BaseObject
: The object to which Object
might be pinned.
IsPinned
Condition:
Description: Checks whether an object (Object
) is pinned to another object (BaseObject
) using the PinTo
behavior.
Usage: Allows event-driven logic based on whether an object is currently linked or “stuck” to another, enabling dynamic game responses based on object relationships.
Parameters:
Object
: The object being checked for pinning.
Behavior
: Specifies the PinTo
behavior attached to the object.
PinTo
Behavior:- Description: This behavior allows an object to be “stuck” or “pinned” to another object, maintaining a relative position, angle, width, and height. It facilitates movement and transformation synchronization between the pinned object and its base object.
- Functions:
onCreated
Action:- Description: Initializes the behavior upon object creation. It sets up scene and behavior-specific methods to manage pinned objects and their updates.
- Functionality: Manages deletion of base objects to automatically unstick related “pinto” objects, preventing dangling references and maintaining scene integrity.
doStepPreEvents
Action:- Description: Executed before each event step to reset the
followingDone
flag, ensuring objects are ready for base object updates.
- Description: Executed before each event step to reset the
doStepPostEvents
Action:- Description: Follows the base object by updating the position, angle, width, and height of the pinned object.
- Functionality: Uses the
followBaseObject
method to synchronize with the base object, updating relative coordinates and transformations.
Stick
Action:- Description: Pins an object to a specified base object.
- Functionality: Establishes the relationship between the pinned object and its base, updating the coordinates and transformations to maintain synchronization.
Unstick
Action:- Description: Removes the pinning, detaching the object from its base.
- Functionality: Breaks the relationship between the pinned object and its base, allowing it to move independently.
onDestroy
Action:- Description: Cleans up the pinned object when it is destroyed.
- Functionality: Removes the behavior from the list of pinned objects, preventing memory leaks and ensuring proper garbage collection.
- Property Descriptors:
OnlyFollowPosition
: Boolean property that, when true, only follows the position of the base object, ignoring angle and dimensions.
ListScroll
extension
(This code is for learning purposes)
The ListScroll
extension is designed to implement a scrolling list functionality in a game development environment, enabling a more dynamic and interactive user interface. It incorporates a PinTo
behavior to manage object positioning relative to a base object, facilitating the creation of scrolling lists.
Usage Scenarios
- Scrolling Lists: The
ListScroll
extension can create scrolling lists where list items (objects with thePinTo
behavior) are pinned to a “viewport” object. As the viewport moves, the list items follow, creating a scrolling effect. - Dynamic UI: Allows for creating user interfaces where elements are dynamically linked and move together, providing a cohesive user experience.
- Complex Object Relationships: Enables the creation of complex object relationships where the behavior of one object influences others, leading to more sophisticated gameplay mechanics.
Summary
The ListScroll
extension, through the PinTo
behavior and associated functions, facilitates dynamic object relationships and scrolling effects. By enabling objects to stick to each other and maintain relative transformations, it enhances the development of complex and interactive game elements.
Moving Platforms
The MovingPlatform
extension facilitates the creation of moving platforms in a game environment. It allows platforms to move vertically (Up/Down) or horizontally (Left/Right) between designated points. Here’s a breakdown of its functionality:
Key Features and Actions
- (Moving Platform) Add moving platform Behavior:
- Description: This is the core behavior added to the base sprite, enabling it to manage the creation and movement of the moving platforms.
- Create Moving Platforms Action:
- Functionality: Creates multiple moving platforms based on the defined base sprite, number of platforms, and direction.
- Parameters:
Object
: The base sprite that contains the movement points.Behavior
: Refers to theMovingPlatform
behavior attached to the base sprite.MovingPlatform
: The sprite object that will serve as the moving platform.Platform
: The PlatformBehavior to enable the moving platform.Quantity
: Specifies how many moving platforms to create.Direction
: The direction of movement (“Up”, “Down”, “Left”, “Right”).Debug
: A text object for displaying debug information.
- Operational Logic:
- Calculates the spacing between platforms based on the base sprite’s dimensions and the specified quantity.
- Iterates through the specified quantity to create each moving platform.
- Positions each platform based on the “Top,” “Bottom,” “Left,” or “Right” points of the base sprite, depending on the chosen direction.
- Links the created
MovingPlatform
object to the baseObject
using theLinkedObjects
behavior. - Sets an object variable
__MovingPlatformDirection__
on theMovingPlatform
to indicate its movement direction. - Alternates the
__MovingPlatformWalkable__
variable toTrue
orFalse
every other platform. This determines whether the platform is initially active. - Activates or deactivates the Platform behavior based on the
__MovingPlatformWalkable__
variable. - Adjusts the Z order (layer) of the moving platforms for visual layering.
Easy way to create moving platforms in GDevelop
Core Functionality
- Moving Platform Creation:
- The extension utilizes two primary sprites:
- Base Sprite: This sprite serves as the foundation for the moving platforms. It requires specific points named “Top” and “Bottom” for vertical movement, or “Left” and “Right” for horizontal movement.
- Moving Platform Sprite: This is the actual platform that will be moving.
- The extension utilizes two primary sprites:
- Directional Movement:
- The platforms can move in four directions: Up, Down, Left, and Right. The direction is determined during platform creation.
- Move Platforms Action:
- Functionality: Initiates the movement of the created platforms.
- Parameters:
Object
: The base sprite managing the moving platforms.Behavior
: TheMovingPlatform
behavior.MovingPlatform
: The moving platform sprite.Platform
: PlatformBehavior to move the platform.Speed
: The speed at which the platforms move (in pixels per second).
- Operational Logic:
- Applies a force to each platform based on its
__MovingPlatformDirection__
variable. - Uses collision checks with the base object’s points to change platform direction.
- Toggles the
__MovingPlatformWalkable__
variable and updates the Z order when a collision is detected. - Activates or deactivates the Platform behavior based on the
__MovingPlatformWalkable__
variable.
- Applies a force to each platform based on its
Required Setup
- Base Sprite Points: The base sprite must have specific points defined:
- For vertical movement: “Top” and “Bottom.”
- For horizontal movement: “Left” and “Right.”
- Moving Platform Sprite: This sprite represents the actual moving platform and should have the Platformer Behavior.
How It Works
- The extension creates moving platforms linked to a base object and moves them in specified directions.
- Collision detection with the base object’s defined points triggers a change in the platform’s movement direction.
- The
__MovingPlatformWalkable__
variable controls whether the platform is active and passable. - The platform’s Z order changes when the direction is toggled, affecting its visual layering in the scene.
Use Cases
- Platformer Games: Creating dynamic and interactive levels with moving platforms.
- Puzzle Games: Designing puzzles that require players to navigate moving platforms.
- Interactive Environments: Adding moving elements to create a more engaging and dynamic game world.
In summary, the MovingPlatform
extension simplifies the creation and management of moving platforms by automating the setup, movement, and collision handling, making it a valuable tool for game developers.
Easy way to create rotating platforms in GDevelop
How it Works:
- Attaching the Behavior: You attach the
RotatingPlatforms
behavior to a sprite object (the base). - Defining Rotation Points: Crucially, you need to add points to your base sprite in the sprite editor. The extension will create a rotating platform sprite at each of these points. The name of these points must follow a pattern: “Point1”, “Point2”, “Point3”, etc.
- Initialization: You use the “Init” action to create the rotating platform sprites at the specified points around the base sprite.
- Rotation Control: You use the “SetSpeed” action to define the rotation speed and direction, and the “Rotate” and “Stop” actions to start and stop the rotation.
In Summary:
This GDevelop extension simplifies the creation of rotating platforms by handling the instantiation, positioning, and rotation logic for you. You just need to provide the sprites, define the rotation points on the base sprite, and control the rotation speed and start/stop actions. The _RotatingPlatform_CanStop_
variable provides individual control over whether specific platforms can be stopped.
Rotating Platforms
This extension provides a behavior to create rotating platforms using two sprites:
Base Sprite: This is the central sprite around which the platforms will rotate. You add “points” to this sprite, which act as locations where the rotating platforms will be created.
Rotating Platform Sprite: This is the sprite that will actually rotate around the base.
The extension allows you to:
- Set the rotation speed, determining the direction (clockwise or counterclockwise) and speed of rotation.
- Start or stop all rotating platforms.
- Control in the game if a rotating platform is allowed to be stopped or not using a variable
_RotatingPlatform_CanStop_
Key Features & Functionality:
Stop (Stop all rotating platforms): Stops the rotation of all platforms using the behavior.
RotatingPlatform Behavior: This is the core behavior you attach to your base sprite.
Object Variables: It introduces a Boolean object variable called _RotatingPlatform_CanStop_
. This variable is initialized to True
at the beginning of the scene for all instances of the object with the behavior. You can change this variable during the game to control whether a specific rotating platform can be stopped or not.
Actions: The extension provides the following actions that you can use in your events:
Init (Create a rotating platform): This action creates the rotating platforms around the base sprite. You specify:
The base sprite.
The sprite to use for the rotating platforms.
The number of platforms to create (quantity). The number of points that contains the base sprite are the quantity of rotating platforms that are going to be created.
Run: This action starts the rotation of the platforms
SetSpeed: This action sets the rotation speed (in seconds). A negative value rotates counter-clockwise, and a positive value rotates clockwise.
Rotate (Start all rotating platforms): Starts the rotation of all platforms using the behavior.
SpikesTrap extension
This GDevelop extension is called “SpikesTrap” and its primary function is to create a timed spike trap in a game. Here’s a breakdown of its functionality:
The extension allows you to set up a trap that triggers when a player collides with it. The trap consists of two parts:
Create spike traps in GDevelop
- Base: A sprite that serves as the base for the spikes.
- Spikes: A sprite that represents the spikes.
Behavior:
When the player collides with the base sprite, the spikes sprite will move up to a certain position, wait for a specified cooldown time, and then move back down to its original position.
Parameters:
The extension has several parameters that can be configured to customize its behavior:
- Player: The player object that will trigger the trap.
- SpikesTrapBase: The base sprite that serves as the foundation for the spikes.
- Spikes: The spikes sprite that will move up and down.
- Tween: A tween behavior that controls the movement of the spikes.
- MoveUpTime: The duration of the upward movement of the spikes in milliseconds.
- MoveDownTime: The duration of the downward movement of the spikes in milliseconds.
- MoveAnimation: The animation to use for the spikes’ movement (e.g., linear, easeInQuad, etc.).
- Cooldown: The time in seconds between upward and downward movements of the spikes.
How it works:
- When the player collides with the base sprite, the extension checks if the spikes sprite is already moving up or down.
- If it’s not moving, it creates a tween behavior to move the spikes sprite up to a certain position.
- After a specified cooldown time, it removes the tween behavior and creates a new one to move the spikes sprite back down to its original position.
- The process repeats indefinitely until the player stops colliding with the base sprite.
Overall, this extension provides a simple and customizable way to create timed spike traps in GDevelop games.