mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
Renamed doc to docs and minor language fixes
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import 'package:flame/flame.dart';
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:flame/components/parallax_component.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void main() async {
|
||||
await Flame.util.fullScreen();
|
||||
runApp(MyGame().widget);
|
||||
}
|
||||
|
||||
class MyGame extends BaseGame {
|
||||
MyGame() {
|
||||
final images = [
|
||||
ParallaxImage("bg.png"),
|
||||
ParallaxImage("mountain-far.png"),
|
||||
ParallaxImage("mountains.png"),
|
||||
ParallaxImage("trees.png"),
|
||||
ParallaxImage("foreground-trees.png"),
|
||||
];
|
||||
|
||||
final parallaxComponent = ParallaxComponent(images,
|
||||
baseSpeed: const Offset(20, 0), layerDelta: const Offset(30, 0));
|
||||
|
||||
add(parallaxComponent);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user