A stunning SpriteKit implementation of the iconic Marvel disintegration effect from Avengers: Infinity War, featuring particle-based dusting animations with layer-by-layer disintegration and reassembly.
- Layer-by-Layer Disintegration: Particles disintegrate from top to bottom in organized layers
- Realistic Particle Physics: 3D coordinate system with perspective projection
- Spiral Movement: Particles spiral toward the upper right corner with organic chaos
- Smooth Transitions: Fade-in and fade-out effects for seamless animations
- Touch Controls: Tap to toggle between disintegration and reassembly
- Animated Rotation: Particles rotate while maintaining disintegration effects
- Dynamic Transformations: Continuous rotation with particle system
- Smooth Scene Transitions: Elegant cross-fade between scenes
- Interactive Experience: Responsive touch controls
- iOS 26.0+
- Xcode 26.0+
- Swift 6.0+
-
Clone the repository
git clone https://github.com/yourusername/DustingSceneKitApp.git cd DustingSceneKitApp -
Open in Xcode
open DustingSceneKitApp.xcodeproj
-
Configure the project
- Select your development team
- Set bundle identifier
- Connect your iOS device or use simulator
-
Build and Run
- Press
Cmd + Rto build and run on your device/simulator
- Press
- Single Tap: Start disintegration effect
- Second Tap: Reverse effect and reassemble particles
- Next Button: Transition to rotating dusting scene
- Back Button: Return to main marvel dusting scene
The app is highly customizable through several parameters:
// Particle System Configuration
private let totalLayers: Int = 16 // Number of disintegration layers
private let layerDelay = 0.1 // Delay between layer activation
let spiralStrength: CGFloat = 2.0 // Spiral effect intensity
let chaosStrength: CGFloat = 1.5 // Random movement intensityParticlestruct with 3D coordinates and physics- Layer-based disintegration system
- Async/await for smooth animations
- Touch gesture handling
- Extended particle rotation system
- Continuous animation loops
- Scene transition management
- Custom image processing for particle generation
- Alpha-based pixel filtering
- Coordinate transformation
- SpriteKit: 2D graphics and animation engine
- Swift Concurrency: Async/await for modern animation timing
- Core Graphics: Image processing and pixel manipulation
- UIKit Integration: Seamless iOS app compatibility
- Add your image to
Assets.xcassets - Update the image name in
createParticlesFromImage(named:) - Adjust scale and positioning parameters as needed
- Efficient Particle System: Optimized for hundreds of particles
- Async Animation Timing: Non-blocking animation sequences
- Memory Management: Automatic particle cleanup
- Frame Rate Stability: Consistent 60FPS performance
- iPhone 8 and newer
- iPad (6th generation) and newer
- iOS 15.0 or later
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Marvel Studios for the iconic visual effect inspiration
- Apple SpriteKit team for the powerful graphics framework
Made with ❤️ and Swift
Experience the magic of Marvel's dusting effect in your own apps!
