mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-31 00:48:47 +08:00
Migrate examples back, change to monorepo (#701)
This commit is contained in:
22
examples/lib/stories/parallax/basic.dart
Normal file
22
examples/lib/stories/parallax/basic.dart
Normal file
@ -0,0 +1,22 @@
|
||||
import 'package:flame/components.dart';
|
||||
import 'package:flame/game.dart';
|
||||
|
||||
class BasicParallaxGame extends BaseGame {
|
||||
final _imageNames = [
|
||||
'parallax/bg.png',
|
||||
'parallax/mountain-far.png',
|
||||
'parallax/mountains.png',
|
||||
'parallax/trees.png',
|
||||
'parallax/foreground-trees.png',
|
||||
];
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
final parallax = await loadParallaxComponent(
|
||||
_imageNames,
|
||||
baseVelocity: Vector2(20, 0),
|
||||
velocityMultiplierDelta: Vector2(1.8, 1.0),
|
||||
);
|
||||
add(parallax);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user