mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
bump version + formatting
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
## next
|
## next
|
||||||
|
|
||||||
|
## 0.14.0
|
||||||
- Adding Timer#isRunning method
|
- Adding Timer#isRunning method
|
||||||
- Adding Timer#progress getter
|
- Adding Timer#progress getter
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ Just drop it in your `pubspec.yaml`:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
dependencies:
|
dependencies:
|
||||||
flame: ^0.13.1
|
flame: ^0.14.0
|
||||||
```
|
```
|
||||||
|
|
||||||
And start using it!
|
And start using it!
|
||||||
|
|||||||
@ -11,9 +11,9 @@ void main() async {
|
|||||||
runApp(game.widget);
|
runApp(game.widget);
|
||||||
|
|
||||||
Flame.util.addGestureRecognizer(TapGestureRecognizer()
|
Flame.util.addGestureRecognizer(TapGestureRecognizer()
|
||||||
..onTapDown = (TapDownDetails evt) {
|
..onTapDown = (TapDownDetails evt) {
|
||||||
game.addAnimation();
|
game.addAnimation();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyGame extends BaseGame {
|
class MyGame extends BaseGame {
|
||||||
@ -21,7 +21,8 @@ class MyGame extends BaseGame {
|
|||||||
textureWidth: 48, textureHeight: 48, stepTime: 0.15);
|
textureWidth: 48, textureHeight: 48, stepTime: 0.15);
|
||||||
|
|
||||||
void addAnimation() {
|
void addAnimation() {
|
||||||
final animationComponent = AnimationComponent(100, 100, animation, destroyOnFinish: true);
|
final animationComponent =
|
||||||
|
AnimationComponent(100, 100, animation, destroyOnFinish: true);
|
||||||
animationComponent.x = size.width / 2 - 50;
|
animationComponent.x = size.width / 2 - 50;
|
||||||
animationComponent.y = 200;
|
animationComponent.y = 200;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import 'package:flame/animation.dart' as flame_animation;
|
|||||||
import 'package:flame/components/animation_component.dart';
|
import 'package:flame/components/animation_component.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
void main() async{
|
void main() async {
|
||||||
final Size size = await Flame.util.initialDimensions();
|
final Size size = await Flame.util.initialDimensions();
|
||||||
runApp(MyGame(size).widget);
|
runApp(MyGame(size).widget);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,6 @@ class MyGame extends BaseGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _start() async {
|
void _start() async {
|
||||||
|
|
||||||
Flame.audio.disableLog();
|
Flame.audio.disableLog();
|
||||||
Flame.audio.load('boin.mp3');
|
Flame.audio.load('boin.mp3');
|
||||||
Flame.audio.loop('music.mp3', volume: 0.4);
|
Flame.audio.loop('music.mp3', volume: 0.4);
|
||||||
|
|||||||
@ -39,7 +39,8 @@ class MyGame extends Game {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void render(Canvas canvas) {
|
void render(Canvas canvas) {
|
||||||
textConfig.render(canvas, "Countdown: ${countdown.current.toString()}", Position(10, 100));
|
textConfig.render(canvas, "Countdown: ${countdown.current.toString()}",
|
||||||
|
Position(10, 100));
|
||||||
textConfig.render(canvas, "Elapsed time: $elapsedSecs", Position(10, 150));
|
textConfig.render(canvas, "Elapsed time: $elapsedSecs", Position(10, 150));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,8 @@ class AnimationComponent extends PositionComponent {
|
|||||||
Animation animation;
|
Animation animation;
|
||||||
bool destroyOnFinish;
|
bool destroyOnFinish;
|
||||||
|
|
||||||
AnimationComponent(double width, double height, this.animation, { this.destroyOnFinish = false }) {
|
AnimationComponent(double width, double height, this.animation,
|
||||||
|
{this.destroyOnFinish = false}) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
}
|
}
|
||||||
@ -23,7 +24,6 @@ class AnimationComponent extends PositionComponent {
|
|||||||
double textureY = 0.0,
|
double textureY = 0.0,
|
||||||
double textureWidth,
|
double textureWidth,
|
||||||
double textureHeight,
|
double textureHeight,
|
||||||
|
|
||||||
this.destroyOnFinish = false,
|
this.destroyOnFinish = false,
|
||||||
}) {
|
}) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/// Simple utility class that helps handling time counting and implementing interval like events.
|
/// Simple utility class that helps handling time counting and implementing interval like events.
|
||||||
///
|
///
|
||||||
class Timer {
|
class Timer {
|
||||||
@ -8,7 +7,7 @@ class Timer {
|
|||||||
double _current = 0;
|
double _current = 0;
|
||||||
bool _running = false;
|
bool _running = false;
|
||||||
|
|
||||||
Timer(this._limit, { bool repeat = false, void Function() callback }) {
|
Timer(this._limit, {bool repeat = false, void Function() callback}) {
|
||||||
_repeat = repeat;
|
_repeat = repeat;
|
||||||
_callback = callback;
|
_callback = callback;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
name: flame
|
name: flame
|
||||||
description: A minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
|
description: A minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
|
||||||
version: 0.13.1
|
version: 0.14.0
|
||||||
author: Luan Nico <luannico27@gmail.com>
|
author: Luan Nico <luannico27@gmail.com>
|
||||||
homepage: https://github.com/luanpotter/flame
|
homepage: https://github.com/luanpotter/flame
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user