Particle API
Emit and control particle systems.
Introduction
Emit and control particle systems. This page provides a complete guide to particle api in Appley, covering everything from setup to advanced techniques.
API Reference is a core area of Appley. Understanding particle api will help you build better games and use the platform more effectively. This documentation is designed for advanced level users.
Requirements
Before working with particle api, ensure you have the following:
- An Appley project with scripts
- Familiarity with Appley Scripting syntax
- The API reference documentation
- Understanding of namespaces (player, world, audio, ui)
Estimated Completion Time
Step-by-Step Guide
Follow these steps to work with particle api in your Appley project:
Read the documentation
Review the particle api reference in these docs. Note method names and parameters.
Open the Script Editor
Switch to the Script tab in Creator Studio.
Use autocomplete
Type the namespace name and press Ctrl+Space to see available methods.
Write the code
Call the API methods with correct parameters. Check return types.
Test and debug
Use debug.log() to verify API outputs. Fix any errors in diagnostics.
FluxScript Example
Below is an Appley Scripting (Flux Scripting) code example demonstrating particle api:
// API Reference — Particle API
on start {
// Player API
player.setPosition(0, 10, 0)
player.setHealth(100)
player.setSpeed(8.0)
// World API
world.spawn("enemy", 5, 0, 5)
world.setTime(14, 30)
// Audio API
audio.play("bgm", { volume: 0.7, loop: true })
// UI API
ui.setText("label", "Hello")
ui.setBar("health", 0.8)
// Math API
dist = math.distance(player.pos, target.pos)
angle = math.atan2(dy, dx)
clamped = math.clamp(value, 0, 100)
// Effects API
effects.spawn("explosion", pos, { scale: 2.0 })
// Save API
save.set("inventory", inventory)
data = save.get("inventory")
// Scene API
scene.load("level2")
}Node Script Example
The same logic can be implemented using Node Scripting. Here is the equivalent node graph:
[On Start] ──► [Player.setPosition]
──► [World.spawn: enemy]
──► [Audio.play: bgm]
──► [UI.setText: label]
──► [Math.distance]
──► [Effects.spawn: explosion]
──► [Save.set: inventory]
──► [Scene.load: level2]Interchangeable Systems
Common Mistakes
Avoid these frequent mistakes when working with particle api:
Not checking API return values
Validate returns from find/get methods before using them.
Calling expensive API methods in on update
Cache results and only call when needed.
Not reading the API documentation
Check method signatures and return types in the docs popover.
Mixing up similar method names
Use autocomplete to verify exact method names and parameters.
Troubleshooting
If you encounter issues with particle api, try these solutions:
Method returns undefined
API call throws an error
Method behaves differently than documented
Autocomplete shows wrong methods
Performance Tips
Optimize your use of particle api with these performance tips:
- Use autocomplete (Ctrl+Space) to discover available methods and parameters.
- Check return types in the docs popover before using API results.
- Cache API results in variables instead of calling methods repeatedly.
- Use the debug API for logging during development: debug.log().
Related Pages
Explore these related documentation pages:
Example Project
Download a complete example project demonstrating particle api:
