These are per-example files generated for LLM usage.
Animation
Animation State Machine - This example demonstrates how to create a character animation system using a Finite State Machine (FSM) with smooth transitions between different character states
Cursor animation - This example shows how to set and animate the normalized cursor value
Easing functions (tweens) - This example demonstrates different easing functions available in Defold
Euler Rotation - This example shows how to animate the rotation of a game object using the euler game object property
Flipbook animation - This example shows how to use a flipbook animation in a sprite
Spine animation - This example shows Spine bone animation that blends when animation switches
Spinner animation - This example shows how a game object is rotated in discrete steps, matching the graphics of the progress spinner
Tween animation - This example shows how to tween animate the position of a game object
Tween animations chain - This example shows how to chain two tween animations of the position of a game object
Basics
Message passing - This example shows how to communicate between two script components in two separate game objects
Parent/child - This example shows how to child a game object to a parent
Random numbers - This example shows how to generate pseudo-random numbers in Defold using built-in math API
Z-order - This example shows how to put sprites in front and behind of eachother
Collection
Proxy - This example shows how to use collection proxies to load and unload collections
Splash - This example shows how to use collection proxies to show a splash screen while loading a game menu
Time-step - This example shows how to speed up or slow down animations in a collection proxy by changing the time step of the collection proxy
Debug
Physics debug - This example allows you to toggle physics debug visualization as well as changing the time step so the simulation runs at one tenth of the speed
Dynamic factories - This example shows how to change the prototype game object used by a factory component
Shoot bullets - This example shows how to dynamically spawn bullet game objects using a factory component
Spawn enemies with central management - This example shows how to spawn enemy game objects using a factory component and use a central manager to control movement and behavior of all enemies
GUI color - This example shows how change the color of GUI nodes at run-time
GUI progress indicators - This example shows how to create various types of progress indicators
Health Bar - This example demonstrates how to add different health bars
Layouts - This example demonstrates the use of layouts
Load texture - This example shows how to load and set a dynamic texture on a gui box node
Localization (RTL/LTR) - This example demonstrates how to handle localization in games, Unicode text layout, RTL rendering, and runtime font switching for localization
Pointer over - A GUI box node with an image texture and a script that react when pointer over this node
Slice-9 - This example demonstrates slice-9 scaling gui box node
Stencil - A GUI box node with “Clipping mode” set to “STENCIL”
Input
8 ways movement - A very simple 8 ways movement setup with a single game object and a script that listens to input and updates the game object position accordingly
Down duration - Listens to input trigger “touch” and count mouse down duration in update method
Entity Picking - This example demonstrates how to pick a game object from the 3D scene
Mouse and touch events - Shows how to read mouse/touch movement and mouse/touch button state
Text input - Listens to text input trigger “type” and modifies the game object label with the alien’s speech according to input
Material
Billboarding - This example shows how to make sprites and particle sprites face the camera using a custom vertex shader
Custom Sprite - This example demonstrates a simple way to create and apply a custom sprite shader for changing colors and customizing an outline
Noise shader - This example shows how to use a noise function to generate clouds, smoke or similar effect using a shader
Repeating Background - Create a scrolling background using a repeating texture on a model quad
Screenspace - This example shows how to create a custom material with two textures that blend together to create a pattern effect using screen space coordinates
Sprite local UV - This example shows how to get local UV coordinates of a sprite regardless of sprite size
ParticleFX emitter properties - This example shows how to get and set ParticleFX emitter image, animation, and material at runtime
Physics
Apply force - This example demonstrates how to apply directional force to all dynamic blocks on touch/click and draws debug direction lines
Dynamic physics - This example shows a simple setup with dynamic physics objects
Fixed timestep interpolation - This example shows how to smooth physics motion in fixed update mode by interpolating a visual sprite while keeping the physics body fixed-step
Hinge joint physics - This example shows a simple setup with a dynamic body physics object and two dynamic wheel physics object joined together with a joint of type “hinge”
Kinematic physics - This example shows a simple setup with a kinematic physics objects
Knockback - This example shows how to create a knockback effect when hit
Pendulum physics - This example shows a simple setup with a static pivot and two dynamic weights - physics objects joined together with a joint of type “fixed” and “spring”
Raycast - This example shows how to use physics raycasts to detect collisions along a straight line from a start point to an end point
Trigger - This example shows how a physics trigger is used to trigger an event
Render
Camera - This example shows how to use a camera component and have it follow a game object
Orbit Camera - This example demonstrates how to create script to control a 3D camera with the mouse
Orthographic Zoom - This example shows how to zoom an orthographic camera in and out by changing Orthographic Zoom while the camera is in Fixed mode
Post-processing - This example shows how to apply a post-processing effect by drawing to a render target and then to a fullscreen quad using a post processing shader
Screen to World - This example shows how to convert from screen to world coordinates while using a camera
World to Screen - This example demonstrates how to convert 3D world coordinates to 2D screen coordinates using camera transformations
Resource
Create atlas - This example shows how to create an atlas with two images and use it on a sprite and in a gui
Modify atlas - This example shows how to replace an image in an atlas
Sound
Fade In-Out - This example shows how to make Fade-In and fade Fade-Out music
Get and set sound - This example shows how to change which sound a sound component plays
Music - This example shows how to play a piece of music, stored as an
Panning - This example demonstrates how to pan a sound effect according to a GO’s(game object) position on the screen
Sprite
Bunnymark - This is a performance test for sprites
Change sprite image - This example shows how to change the image of a sprite
Flip - This example demonstrates flipping a sprite animation vertically and horizontally
Multiple Sprite Samplers - This example shows how to sample from more than one image when drawing a sprite
Sprite cursor - This example shows how to use the sprite animation cursor and frame count to manually select a specific frame
Sprite size - This example shows how to get the size of a sprite at run-time
Sprite tint - This example shows how tint a sprite at run-time
Texture scrolling - This example shows how scroll the texture in the runtime using Texture Transform 2D Vertex Attribute, without using the sprite in the world space
Tilemap
Get and set tiles - This example shows how to get and set tiles of a tilemap
Tilemap collisions - This example shows how to detect collisions on tilemaps
Timer
Cancel timer example - This example shows how to create timer and cancel it anytime, using built-in timer API
Repeating timer example - This example shows how to create timer that repeats endlessly every second
Trigger timer example - This example shows how to create timer that triggers counting every 1s and can be triggered manually and asynchronously as a reaction to user input