forked from marco/firo_runner
changes
This commit is contained in:
parent
e56c4fada4
commit
651a8e932f
@ -1,3 +1,9 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
@ -6,10 +12,10 @@ if (localPropertiesFile.exists()) {
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
}
|
||||
// def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
// if (flutterRoot == null) {
|
||||
// throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
// }
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
@ -21,17 +27,17 @@ if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
// apply plugin: 'com.android.application'
|
||||
// apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 34
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.firogames.firo_runner"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion 34
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
@ -48,3 +54,8 @@ android {
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
|
||||
// dependencies {
|
||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20"
|
||||
// }
|
@ -7,6 +7,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
|
@ -1,13 +1,13 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
// buildscript {
|
||||
// repositories {
|
||||
// google()
|
||||
// jcenter()
|
||||
// }
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
}
|
||||
}
|
||||
// dependencies {
|
||||
// classpath 'com.android.tools.build:gradle:4.1.0'
|
||||
// }
|
||||
// }
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
@ -22,6 +22,6 @@ subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
|
||||
|
@ -1,11 +1,38 @@
|
||||
include ':app'
|
||||
// include ':app'
|
||||
|
||||
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
def properties = new Properties()
|
||||
// def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
|
||||
// def properties = new Properties()
|
||||
|
||||
assert localPropertiesFile.exists()
|
||||
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
// assert localPropertiesFile.exists()
|
||||
// localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
|
||||
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
// def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
// assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
// apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
||||
|
||||
|
||||
pluginManagement {
|
||||
def flutterSdkPath = {
|
||||
def properties = new Properties()
|
||||
file("local.properties").withInputStream { properties.load(it) }
|
||||
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||
return flutterSdkPath
|
||||
}()
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "7.3.0" apply false
|
||||
id "org.jetbrains.kotlin.android" version "1.7.20" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
@ -5,7 +5,6 @@ import 'package:flame/components.dart';
|
||||
import 'package:flame/extensions.dart';
|
||||
import 'package:flame/flame.dart';
|
||||
import 'package:flame_audio/flame_audio.dart';
|
||||
import 'package:audioplayers/src/api/player_mode.dart';
|
||||
|
||||
enum FireworkState { normal }
|
||||
|
||||
@ -48,11 +47,10 @@ class Firework extends Component {
|
||||
current: FireworkState.normal,
|
||||
);
|
||||
|
||||
sprite1.changePriorityWithoutResorting(FIREWORK_PRIORITY);
|
||||
sprite1.priority = FIREWORK_PRIORITY;
|
||||
sprite1.update(100);
|
||||
|
||||
sprite1.size =
|
||||
Vector2(gameRef.viewport.canvasSize.y, gameRef.viewport.canvasSize.y);
|
||||
sprite1.size = Vector2(gameRef.canvasSize.y, gameRef.canvasSize.y);
|
||||
sprite1.position = Vector2(0, 0);
|
||||
|
||||
sprite2 = SpriteAnimationGroupComponent(
|
||||
@ -62,12 +60,10 @@ class Firework extends Component {
|
||||
current: FireworkState.normal,
|
||||
);
|
||||
|
||||
sprite2.changePriorityWithoutResorting(FIREWORK_PRIORITY);
|
||||
sprite2.priority = FIREWORK_PRIORITY;
|
||||
|
||||
sprite2.size =
|
||||
Vector2(gameRef.viewport.canvasSize.y, gameRef.viewport.canvasSize.y);
|
||||
sprite2.position =
|
||||
Vector2(gameRef.viewport.canvasSize.x - sprite2.size.x, 0);
|
||||
sprite2.size = Vector2(gameRef.canvasSize.y, gameRef.canvasSize.y);
|
||||
sprite2.position = Vector2(gameRef.canvasSize.x - sprite2.size.x, 0);
|
||||
sprite2.update(100);
|
||||
}
|
||||
|
||||
@ -80,7 +76,7 @@ class Firework extends Component {
|
||||
|
||||
@override
|
||||
void update(double dt) {
|
||||
if (!(sprite1.animation?.done() ?? false)) {
|
||||
if (!(sprite1.animationTicker?.done() ?? false)) {
|
||||
timeSinceFirework = 0;
|
||||
} else {
|
||||
timeSinceFirework += dt;
|
||||
@ -92,27 +88,27 @@ class Firework extends Component {
|
||||
void renderText(Canvas canvas) {
|
||||
sprite1.render(canvas);
|
||||
sprite1.render(canvas);
|
||||
if ((sprite1.animation?.done() ?? false) &&
|
||||
final textPainter = gameRef.fireworksPaint.toTextPainter(message);
|
||||
textPainter.layout();
|
||||
final textWidth = textPainter.width;
|
||||
final textHeight = textPainter.height;
|
||||
if ((sprite1.animationTicker?.done() ?? false) &&
|
||||
timeSinceFirework < 1 &&
|
||||
message != "") {
|
||||
gameRef.fireworksPaint.render(
|
||||
canvas,
|
||||
message,
|
||||
Vector2(
|
||||
gameRef.size.x / 2 -
|
||||
gameRef.fireworksPaint.measureTextWidth(message) / 2,
|
||||
gameRef.size.y / 9 -
|
||||
gameRef.fireworksPaint.measureTextHeight(message) / 2),
|
||||
Vector2(gameRef.size.x / 2 - textWidth / 2,
|
||||
gameRef.size.y / 9 - textHeight / 2),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void reset() {
|
||||
message = messages.elementAt(random.nextInt(messages.length));
|
||||
sprite1.animation!.reset();
|
||||
sprite2.animation!.reset();
|
||||
FlameAudio.audioCache
|
||||
.play("sfx/fireworks.mp3", volume: 0.75, mode: PlayerMode.LOW_LATENCY);
|
||||
sprite1.animationTicker!.reset();
|
||||
sprite2.animationTicker!.reset();
|
||||
FlameAudio.play("sfx/fireworks.mp3", volume: 0.75);
|
||||
}
|
||||
|
||||
void resize(Vector2 newSize, double xRatio, double yRatio) {
|
||||
|
@ -131,19 +131,19 @@ class GameState extends Component {
|
||||
if (!isPaused) {
|
||||
switch (getLevel()) {
|
||||
case 7:
|
||||
return gameRef.viewport.canvasSize.x * 0.30;
|
||||
return gameRef.canvasSize.x * 0.30;
|
||||
case 6:
|
||||
return gameRef.viewport.canvasSize.x * 0.28;
|
||||
return gameRef.canvasSize.x * 0.28;
|
||||
case 5:
|
||||
return gameRef.viewport.canvasSize.x * 0.26;
|
||||
return gameRef.canvasSize.x * 0.26;
|
||||
case 4:
|
||||
return gameRef.viewport.canvasSize.x * 0.24;
|
||||
return gameRef.canvasSize.x * 0.24;
|
||||
case 3:
|
||||
return gameRef.viewport.canvasSize.x * 0.22;
|
||||
return gameRef.canvasSize.x * 0.22;
|
||||
case 2:
|
||||
return gameRef.viewport.canvasSize.x * 0.20;
|
||||
return gameRef.canvasSize.x * 0.20;
|
||||
default:
|
||||
return gameRef.viewport.canvasSize.x * 0.18;
|
||||
return gameRef.canvasSize.x * 0.18;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -63,7 +63,7 @@ class BugHolder extends Holder {
|
||||
if (platform != null) {
|
||||
platform.removeChildren.add(() {
|
||||
objects[level].remove(bug);
|
||||
bug.remove();
|
||||
gameRef.remove(bug);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
@ -23,7 +23,7 @@ class CoinHolder extends Holder {
|
||||
current: CoinState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(COIN_PRIORITY);
|
||||
sprite.priority = COIN_PRIORITY;
|
||||
|
||||
sprite.size = Vector2(20, 20);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ class DebrisHolder extends Holder {
|
||||
if (platform != null) {
|
||||
platform.removeChildren.add(() {
|
||||
objects[level].remove(debris);
|
||||
debris.remove();
|
||||
gameRef.remove(debris);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
@ -48,7 +48,7 @@ class Holder {
|
||||
|
||||
// Remove and object from this holder.
|
||||
void remove(List<MovingObject> levelHolder, int j) {
|
||||
levelHolder[j].remove();
|
||||
levelHolder[j].removeSprite();
|
||||
levelHolder.removeAt(j);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ class WallHolder extends Holder {
|
||||
if (platform != null) {
|
||||
platform.removeChildren.add(() {
|
||||
objects[level].remove(wall);
|
||||
wall.remove();
|
||||
gameRef.remove(wall);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
@ -44,9 +44,9 @@ class WireHolder extends Holder {
|
||||
}
|
||||
|
||||
Wire wire = Wire(gameRef);
|
||||
wire.sprite.renderFlipX = true;
|
||||
wire.sprite.flipHorizontally();
|
||||
if (level % 3 == 0) {
|
||||
wire.sprite.renderFlipY = true;
|
||||
wire.sprite.flipVertically();
|
||||
wire.setPosition(
|
||||
xCoordinate, gameRef.blockSize * level - 2 * gameRef.blockSize / 7);
|
||||
} else {
|
||||
@ -63,7 +63,7 @@ class WireHolder extends Holder {
|
||||
if (platform != null) {
|
||||
platform.removeChildren.add(() {
|
||||
objects[level].remove(wire);
|
||||
wire.remove();
|
||||
gameRef.remove(wire);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
@ -16,12 +16,12 @@ import 'package:firo_runner/overlays/sign_in_overlay.dart';
|
||||
import 'package:firo_runner/holders/wall_holder.dart';
|
||||
import 'package:firo_runner/moving_objects/wire.dart';
|
||||
import 'package:firo_runner/holders/wire_holder.dart';
|
||||
import 'package:flame/camera.dart';
|
||||
import 'package:flame/components.dart';
|
||||
import 'package:flame/events.dart';
|
||||
import 'package:flame/extensions.dart';
|
||||
import 'package:flame/flame.dart';
|
||||
import 'package:flame/game.dart';
|
||||
import 'package:flame/gestures.dart';
|
||||
import 'package:flame/keyboard.dart';
|
||||
import 'package:flame_audio/flame_audio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@ -96,8 +96,8 @@ void main() async {
|
||||
'loading': (_, myGame) {
|
||||
return Center(
|
||||
child: Container(
|
||||
height: myGame.viewport.canvasSize.y,
|
||||
width: myGame.viewport.canvasSize.x,
|
||||
height: myGame.canvasSize.y,
|
||||
width: myGame.canvasSize.x,
|
||||
color: Colors.black,
|
||||
),
|
||||
);
|
||||
@ -132,14 +132,14 @@ int getNearestPlatform(int level) {
|
||||
: 8;
|
||||
}
|
||||
|
||||
class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
class MyGame extends FlameGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
TextPaint fireworksPaint = TextPaint(
|
||||
config: const TextPaintConfig(
|
||||
style: TextStyle(
|
||||
fontSize: 48.0, fontFamily: 'Codystar', color: FIREWORK_COLOR),
|
||||
);
|
||||
|
||||
TextPaint scoresPaint = TextPaint(
|
||||
config: const TextPaintConfig(fontSize: 16.0, color: FIREWORK_COLOR),
|
||||
style: TextStyle(fontSize: 16.0, color: FIREWORK_COLOR),
|
||||
);
|
||||
|
||||
String leaderboard = "";
|
||||
@ -163,7 +163,8 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
late GameState gameState;
|
||||
late double blockSize;
|
||||
|
||||
bool loaded = false;
|
||||
@override
|
||||
bool isLoaded = false;
|
||||
bool firstDeath = true;
|
||||
late Wire wire;
|
||||
late TextComponent _distance;
|
||||
@ -171,7 +172,7 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
int startLoading = 0;
|
||||
|
||||
MyGame() : super() {
|
||||
viewport.resize(Vector2(1920, 1080));
|
||||
FixedResolutionViewport(resolution: Vector2(1920, 1080));
|
||||
}
|
||||
|
||||
// Load the game and all of its assets, may take a couple of seconds.
|
||||
@ -236,15 +237,19 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
await runner.load();
|
||||
|
||||
// Set up game UI
|
||||
loaded = true;
|
||||
_distance = TextComponent("Time: 0",
|
||||
position: Vector2(size.x - 100, 10), textRenderer: scoresPaint)
|
||||
isLoaded = true;
|
||||
_distance = TextComponent(
|
||||
text: "Time: 0",
|
||||
position: Vector2(size.x - 100, 10),
|
||||
textRenderer: scoresPaint)
|
||||
..anchor = Anchor.topRight;
|
||||
_distance.changePriorityWithoutResorting(OVERLAY_PRIORITY);
|
||||
_coins = TextComponent(": 0",
|
||||
position: Vector2(size.x - 20, 10), textRenderer: scoresPaint)
|
||||
_distance.priority = OVERLAY_PRIORITY;
|
||||
_coins = TextComponent(
|
||||
text: ": 0",
|
||||
position: Vector2(size.x - 20, 10),
|
||||
textRenderer: scoresPaint)
|
||||
..anchor = Anchor.topRight;
|
||||
_coins.changePriorityWithoutResorting(OVERLAY_PRIORITY);
|
||||
_coins.priority = OVERLAY_PRIORITY;
|
||||
|
||||
// add all overlays first since the first time they are added there is a
|
||||
// delay, so calling it earlier makes a smoother experience.
|
||||
@ -403,7 +408,7 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
|
||||
// Put the loss screen up.
|
||||
Future<void> displayLoss() async {
|
||||
if (!(runner.sprite.animation?.done() ?? false) &&
|
||||
if (!(runner.sprite.animationTicker?.done() ?? false) &&
|
||||
runner.sprite.animation!.loop == false &&
|
||||
firstDeath) {
|
||||
return;
|
||||
@ -422,11 +427,11 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
|
||||
// reset the game.
|
||||
void reset() {
|
||||
runner.sprite.animation!.reset();
|
||||
runner.sprite.animationTicker!.reset();
|
||||
overlays.remove('gameOver');
|
||||
overlays.remove('mainMenu');
|
||||
shouldReset = false;
|
||||
components.clear();
|
||||
children.clear();
|
||||
setUp();
|
||||
}
|
||||
|
||||
@ -456,7 +461,7 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
void setUp() {
|
||||
add(runner);
|
||||
fireworks.setUp();
|
||||
runner.sprite.clearEffects();
|
||||
runner.sprite.animations?.clear();
|
||||
runner.sprite.current = RunnerState.run;
|
||||
circuitBackground.setUp();
|
||||
platformHolder.setUp();
|
||||
@ -524,11 +529,11 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
}
|
||||
|
||||
@override
|
||||
void onResize(Vector2 canvasSize) {
|
||||
Vector2 oldSize = viewport.canvasSize;
|
||||
super.onResize(canvasSize);
|
||||
void onGameResize(Vector2 canvasSize) {
|
||||
Vector2 oldSize = canvasSize;
|
||||
super.onGameResize(canvasSize);
|
||||
blockSize = canvasSize.y / 9;
|
||||
if (loaded) {
|
||||
if (isLoaded) {
|
||||
double xRatio = canvasSize.x / oldSize.x;
|
||||
double yRatio = canvasSize.y / oldSize.y;
|
||||
circuitBackground.resize(canvasSize, xRatio, yRatio);
|
||||
@ -556,8 +561,8 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
|
||||
@override
|
||||
void onPanUpdate(DragUpdateInfo info) {
|
||||
xDeltas.add(info.delta.game.x);
|
||||
yDeltas.add(info.delta.game.y);
|
||||
xDeltas.add(info.delta.global.x);
|
||||
yDeltas.add(info.delta.global.y);
|
||||
if (xDeltas.length > 2 && !action) {
|
||||
action = true;
|
||||
if (!playingMusic && kIsWeb) {
|
||||
@ -605,36 +610,41 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
// Keyboard controls.
|
||||
var keyboardKey;
|
||||
@override
|
||||
void onKeyEvent(RawKeyEvent event) {
|
||||
KeyEventResult onKeyEvent(KeyEvent event, Set<LogicalKeyboardKey> keys) {
|
||||
if (!playingMusic && kIsWeb) {
|
||||
playMusic();
|
||||
}
|
||||
if (event is RawKeyDownEvent) {
|
||||
if (event is KeyDownEvent) {
|
||||
action = true;
|
||||
keyboardKey = null;
|
||||
switch (event.data.logicalKey.keyId) {
|
||||
switch (event.logicalKey.keyId) {
|
||||
case 4294968068:
|
||||
case 119:
|
||||
case 87:
|
||||
// case "w":
|
||||
|
||||
runner.control("up");
|
||||
break;
|
||||
case 4294968066:
|
||||
case 97:
|
||||
case 65:
|
||||
// case "a":
|
||||
|
||||
runner.control("left");
|
||||
|
||||
break;
|
||||
case 4294968065:
|
||||
case 115:
|
||||
case 83:
|
||||
// case "s":
|
||||
|
||||
runner.control("down");
|
||||
break;
|
||||
case 4294968067:
|
||||
case 100:
|
||||
case 68:
|
||||
// case "d":
|
||||
|
||||
runner.control("right");
|
||||
break;
|
||||
default:
|
||||
@ -642,8 +652,11 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents {
|
||||
}
|
||||
}
|
||||
|
||||
if (event is RawKeyUpEvent) {
|
||||
if (event is KeyUpEvent) {
|
||||
action = false;
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class Bug extends MovingObject {
|
||||
current: BugState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(BUG_PRIORITY);
|
||||
sprite.priority = BUG_PRIORITY;
|
||||
|
||||
setSize(
|
||||
gameRef.blockSize,
|
||||
|
@ -152,9 +152,9 @@ class CircuitBackground extends MovingObject {
|
||||
current: OverlayState.first,
|
||||
);
|
||||
|
||||
overlayA.changePriorityWithoutResorting(WINDOW_PRIORITY - 1);
|
||||
overlayA.priority = WINDOW_PRIORITY - 1;
|
||||
|
||||
overlayA.changePriorityWithoutResorting(WINDOW_PRIORITY - 1);
|
||||
overlayA.priority = WINDOW_PRIORITY - 1;
|
||||
|
||||
windows0 = await Flame.images.load("windows-0.png");
|
||||
windows1 = await Flame.images.load("windows-1.png");
|
||||
@ -246,9 +246,9 @@ class CircuitBackground extends MovingObject {
|
||||
current: WindowState.first,
|
||||
);
|
||||
|
||||
windowA.changePriorityWithoutResorting(WINDOW_PRIORITY);
|
||||
windowA.priority = WINDOW_PRIORITY;
|
||||
|
||||
windowA.changePriorityWithoutResorting(WINDOW_PRIORITY);
|
||||
windowA.priority = WINDOW_PRIORITY;
|
||||
|
||||
setUp();
|
||||
}
|
||||
@ -260,8 +260,8 @@ class CircuitBackground extends MovingObject {
|
||||
overlayB.current = OverlayState.first;
|
||||
background1Position = Vector2(0, 0);
|
||||
background1Size = Vector2(
|
||||
gameRef.viewport.canvasSize.y * (background.width / background.height),
|
||||
gameRef.viewport.canvasSize.y);
|
||||
gameRef.canvasSize.y * (background.width / background.height),
|
||||
gameRef.canvasSize.y);
|
||||
windowA.position = background1Position;
|
||||
windowA.size = background1Size;
|
||||
overlayA.position = background1Position;
|
||||
@ -270,8 +270,8 @@ class CircuitBackground extends MovingObject {
|
||||
background2Position =
|
||||
Vector2(background1Position.x + background1Size.x - 1, 0);
|
||||
background2Size = Vector2(
|
||||
gameRef.viewport.canvasSize.y * (background.width / background.height),
|
||||
gameRef.viewport.canvasSize.y);
|
||||
gameRef.canvasSize.y * (background.width / background.height),
|
||||
gameRef.canvasSize.y);
|
||||
windowB.position = background2Position;
|
||||
windowB.size = background2Size;
|
||||
overlayB.position = background2Position;
|
||||
|
@ -16,7 +16,7 @@ class Coin extends MovingObject {
|
||||
current: CoinState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(COIN_PRIORITY);
|
||||
sprite.priority = COIN_PRIORITY;
|
||||
|
||||
var platform = gameRef.platformHolder.l1[0].image;
|
||||
|
||||
|
@ -16,7 +16,7 @@ class Debris extends MovingObject {
|
||||
current: DebrisState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(DEBRIS_PRIORITY);
|
||||
sprite.priority = DEBRIS_PRIORITY;
|
||||
|
||||
setSize(
|
||||
gameRef.blockSize *
|
||||
|
@ -1,12 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:firo_runner/main.dart';
|
||||
import 'package:flame/components.dart';
|
||||
|
||||
// Class meant to be extended by any object that will move left on the screen.
|
||||
// Ensures a relatively constant moving velocity, and takes care of sprite
|
||||
// animations and positioning.
|
||||
class MovingObject {
|
||||
class MovingObject extends Component {
|
||||
late SpriteAnimationGroupComponent sprite;
|
||||
MyGame gameRef;
|
||||
|
||||
@ -21,21 +17,26 @@ class MovingObject {
|
||||
}
|
||||
|
||||
Sprite getSprite() {
|
||||
return sprite.animation!.getSprite();
|
||||
return sprite.animationTicker!.getSprite();
|
||||
}
|
||||
|
||||
@override
|
||||
void update(double dt) {
|
||||
double velocity = gameRef.gameState.getVelocity();
|
||||
sprite.position = sprite.position - Vector2(velocity * dt, 0);
|
||||
}
|
||||
|
||||
// Get the rightmost pixel position of this sprite.
|
||||
@override
|
||||
void render(Canvas canvas) {
|
||||
sprite.render(canvas);
|
||||
}
|
||||
|
||||
double getRightEnd() {
|
||||
return sprite.position.x + sprite.width;
|
||||
}
|
||||
|
||||
void remove() {
|
||||
sprite.remove();
|
||||
void removeSprite() {
|
||||
gameRef.remove(sprite);
|
||||
}
|
||||
|
||||
// See where this object intersects another object if at all.
|
||||
|
@ -47,8 +47,7 @@ class Platform extends MovingObject {
|
||||
current: PlatformState.mid,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(PLATFORM_PRIORITY);
|
||||
|
||||
sprite.priority = PLATFORM_PRIORITY;
|
||||
setSize(
|
||||
gameRef.blockSize *
|
||||
(gameRef.platformHolder.l1[0].image.width /
|
||||
@ -58,9 +57,9 @@ class Platform extends MovingObject {
|
||||
}
|
||||
|
||||
@override
|
||||
void remove() {
|
||||
void removeFromParent() {
|
||||
removeChildrenObjects();
|
||||
super.remove();
|
||||
super.removeFromParent();
|
||||
}
|
||||
|
||||
void removeChildrenObjects() {
|
||||
|
@ -18,7 +18,7 @@ class Wall extends MovingObject {
|
||||
current: WallState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(WALL_PRIORITY);
|
||||
sprite.priority = WALL_PRIORITY;
|
||||
|
||||
setSize(
|
||||
gameRef.blockSize *
|
||||
|
@ -17,7 +17,7 @@ class Wire extends MovingObject {
|
||||
current: WireState.normal,
|
||||
);
|
||||
|
||||
sprite.changePriorityWithoutResorting(WIRE_PRIORITY);
|
||||
sprite.priority = WIRE_PRIORITY;
|
||||
|
||||
setSize(
|
||||
gameRef.blockSize,
|
||||
|
@ -14,7 +14,7 @@ class DepositOverlay extends StatelessWidget {
|
||||
List<Widget> getDepositAddress(double width) {
|
||||
List<Widget> list = [];
|
||||
if (game.address.length != 34) {}
|
||||
list.add(QrImage(
|
||||
list.add(QrImageView(
|
||||
data: game.address,
|
||||
version: QrVersions.auto,
|
||||
size: width / 5,
|
||||
@ -50,8 +50,8 @@ class DepositOverlay extends StatelessWidget {
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: game.viewport.canvasSize.y,
|
||||
width: game.viewport.canvasSize.x,
|
||||
height: game.canvasSize.y,
|
||||
width: game.canvasSize.x,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: lossImage,
|
||||
|
@ -140,8 +140,8 @@ class LeaderBoardOverlay extends StatelessWidget {
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: game.viewport.canvasSize.y,
|
||||
width: game.viewport.canvasSize.x,
|
||||
height: game.canvasSize.y,
|
||||
width: game.canvasSize.x,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: lossImage,
|
||||
|
@ -3,8 +3,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../main.dart';
|
||||
|
||||
import 'package:audioplayers/src/api/player_mode.dart';
|
||||
|
||||
class LoseMenuOverlay extends StatelessWidget {
|
||||
const LoseMenuOverlay({
|
||||
Key? key,
|
||||
@ -18,8 +16,8 @@ class LoseMenuOverlay extends StatelessWidget {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Center(
|
||||
child: Container(
|
||||
height: game.viewport.canvasSize.y,
|
||||
width: game.viewport.canvasSize.x,
|
||||
height: game.canvasSize.y,
|
||||
width: game.canvasSize.x,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: lossImage,
|
||||
@ -65,8 +63,7 @@ class LoseMenuOverlay extends StatelessWidget {
|
||||
// ),
|
||||
onPressed: () async {
|
||||
// Go to the Main Menu
|
||||
await FlameAudio.audioCache.play('sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
await FlameAudio.play('sfx/button_click.mp3');
|
||||
game.mainMenu();
|
||||
},
|
||||
),
|
||||
@ -98,11 +95,9 @@ class LoseMenuOverlay extends StatelessWidget {
|
||||
onPressed: game.competitive && game.tries <= 0
|
||||
? null
|
||||
: () async {
|
||||
await FlameAudio.audioCache.play(
|
||||
'sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
game.runner.friend = await FlameAudio.audioCache
|
||||
.loop('sfx/robot_friend_beep.mp3');
|
||||
await FlameAudio.play('sfx/button_click.mp3');
|
||||
game.runner.friend = await FlameAudio.loop(
|
||||
'sfx/robot_friend_beep.mp3');
|
||||
game.reset();
|
||||
},
|
||||
),
|
||||
|
@ -1,7 +1,6 @@
|
||||
import 'package:flame_audio/flame_audio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:audioplayers/src/api/player_mode.dart';
|
||||
import '../main.dart';
|
||||
|
||||
class MainMenuOverlay extends StatelessWidget {
|
||||
@ -17,8 +16,8 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Center(
|
||||
child: Container(
|
||||
height: game.viewport.canvasSize.y,
|
||||
width: game.viewport.canvasSize.x,
|
||||
height: game.canvasSize.y,
|
||||
width: game.canvasSize.x,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: mainMenuImage,
|
||||
@ -68,20 +67,16 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
),
|
||||
onPressed: () async {
|
||||
// Go to the Main Menu
|
||||
FlameAudio.audioCache.play('sfx/menu_button.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/menu_button.mp3');
|
||||
game.competitive = false;
|
||||
game.reset();
|
||||
game.runner.boost = FlameAudio.audioCache.play(
|
||||
'sfx/laser.mp3',
|
||||
volume: 0.0,
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
game.runner.boost =
|
||||
FlameAudio.play('sfx/laser.mp3', volume: 0.0);
|
||||
FlameAudio.bgm.stop();
|
||||
FlameAudio.bgm.play('Infinite_Spankage_M.mp3');
|
||||
game.runner.friend = await FlameAudio.audioCache.loop(
|
||||
game.runner.friend = await FlameAudio.loop(
|
||||
'sfx/robot_friend_beep.mp3',
|
||||
volume: 0.25,
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
volume: 0.25);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -118,9 +113,7 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
: () async {
|
||||
game.address = await game.connectServer(
|
||||
"deposit", "user=${game.username}");
|
||||
FlameAudio.audioCache.play(
|
||||
'sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/button_click.mp3');
|
||||
game.overlays.add("deposit");
|
||||
},
|
||||
),
|
||||
@ -150,23 +143,18 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
? null
|
||||
: () async {
|
||||
// Go to the Main Menu
|
||||
FlameAudio.audioCache.play(
|
||||
'sfx/menu_button.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
game.runner.boost = FlameAudio.audioCache
|
||||
.play('sfx/laser.mp3',
|
||||
volume: 0.0,
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/menu_button.mp3');
|
||||
game.runner.boost = FlameAudio.play(
|
||||
'sfx/laser.mp3',
|
||||
volume: 0.0);
|
||||
game.competitive = true;
|
||||
game.reset();
|
||||
FlameAudio.bgm.stop();
|
||||
FlameAudio.bgm
|
||||
.play('Infinite_Spankage_M.mp3');
|
||||
game.runner.friend = await FlameAudio
|
||||
.audioCache
|
||||
.loop('sfx/robot_friend_beep.mp3',
|
||||
volume: 0.25,
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
game.runner.friend = await FlameAudio.loop(
|
||||
'sfx/robot_friend_beep.mp3',
|
||||
volume: 0.25);
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -197,8 +185,7 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
FlameAudio.audioCache.play('sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/button_click.mp3');
|
||||
game.overlays.add("signin");
|
||||
},
|
||||
),
|
||||
@ -224,8 +211,7 @@ class MainMenuOverlay extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
game.leaderboard = await game.connectServer(
|
||||
"leaderboard", "user=value");
|
||||
FlameAudio.audioCache.play('sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/button_click.mp3');
|
||||
game.overlays.add("leaderboard");
|
||||
},
|
||||
),
|
||||
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../main.dart';
|
||||
import 'package:audioplayers/src/api/player_mode.dart';
|
||||
|
||||
/// This is the stateful widget that the main application instantiates.
|
||||
class SignInOverlay extends StatefulWidget {
|
||||
@ -32,8 +31,8 @@ class _MyStatefulWidgetState extends State<SignInOverlay> {
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: widget.game.viewport.canvasSize.y,
|
||||
width: widget.game.viewport.canvasSize.x,
|
||||
height: widget.game.canvasSize.y,
|
||||
width: widget.game.canvasSize.x,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: lossImage,
|
||||
@ -88,9 +87,7 @@ class _MyStatefulWidgetState extends State<SignInOverlay> {
|
||||
onPressed: () async {
|
||||
// // Validate will return true if the form is valid, or false if
|
||||
// // the form is invalid.
|
||||
FlameAudio.audioCache.play(
|
||||
'sfx/button_click.mp3',
|
||||
mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/button_click.mp3');
|
||||
if (!_formKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
|
228
lib/runner.dart
228
lib/runner.dart
@ -10,7 +10,6 @@ import 'package:flame/components.dart';
|
||||
import 'package:flame/image_composition.dart';
|
||||
import 'package:flame_audio/flame_audio.dart';
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:audioplayers/src/api/player_mode.dart';
|
||||
|
||||
enum RunnerState {
|
||||
run,
|
||||
@ -66,7 +65,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
}
|
||||
|
||||
Sprite getSprite() {
|
||||
return sprite.animation!.getSprite();
|
||||
return sprite.animationTicker!.getSprite();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -88,26 +87,31 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
if (gameRef.gameState.isPaused) {
|
||||
return;
|
||||
}
|
||||
sprite.animation!.reset();
|
||||
sprite.animationTicker!.reset();
|
||||
switch (event) {
|
||||
case "jump":
|
||||
previousState = runnerState;
|
||||
runnerState = event;
|
||||
runnerState = "jump";
|
||||
sprite.current = RunnerState.jump;
|
||||
sprite.addEffect(MoveEffect(
|
||||
path: [
|
||||
// sprite.position,
|
||||
Vector2(sprite.x, (level - 1) * gameRef.blockSize),
|
||||
],
|
||||
duration: 0.15,
|
||||
curve: Curves.bounceIn,
|
||||
print('jump');
|
||||
sprite.add(MoveToEffect(
|
||||
// sprite.position,
|
||||
Vector2(sprite.x, (level - 1) * gameRef.blockSize),
|
||||
EffectController(
|
||||
duration: 0.15,
|
||||
curve: Curves.bounceIn,
|
||||
),
|
||||
|
||||
onComplete: () {
|
||||
print('complete jump');
|
||||
updateLevel();
|
||||
this.event("float");
|
||||
},
|
||||
));
|
||||
break;
|
||||
case "double_jump":
|
||||
print('double_jump');
|
||||
|
||||
if (belowPlatform()) {
|
||||
break;
|
||||
}
|
||||
@ -128,12 +132,12 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
sprite.current = RunnerState.float;
|
||||
break;
|
||||
}
|
||||
sprite.addEffect(MoveEffect(
|
||||
path: [
|
||||
Vector2(sprite.x, (level - 2) * gameRef.blockSize),
|
||||
],
|
||||
duration: 0.20,
|
||||
curve: Curves.ease,
|
||||
sprite.add(MoveToEffect(
|
||||
Vector2(sprite.x, (level - 2) * gameRef.blockSize),
|
||||
EffectController(
|
||||
duration: 0.20,
|
||||
curve: Curves.ease,
|
||||
),
|
||||
onComplete: () {
|
||||
updateLevel();
|
||||
clearEffects();
|
||||
@ -146,17 +150,20 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
));
|
||||
break;
|
||||
case "fall":
|
||||
print('fall');
|
||||
|
||||
previousState = runnerState;
|
||||
clearEffects();
|
||||
runnerState = event;
|
||||
sprite.current = RunnerState.fall;
|
||||
sprite.addEffect(getFallingEffect());
|
||||
sprite.add(getFallingEffect());
|
||||
break;
|
||||
case "kick":
|
||||
print('kick');
|
||||
|
||||
previousState = runnerState;
|
||||
runnerState = event;
|
||||
boost = FlameAudio.audioCache
|
||||
.play('sfx/laser.mp3', volume: 1.0, mode: PlayerMode.LOW_LATENCY);
|
||||
boost = FlameAudio.play('sfx/laser.mp3', volume: 1.0);
|
||||
switch (gameRef.gameState.getRobotLevel()) {
|
||||
case 3:
|
||||
sprite.current = RunnerState.kick3;
|
||||
@ -170,15 +177,16 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
}
|
||||
break;
|
||||
case "run":
|
||||
print('run');
|
||||
previousState = runnerState;
|
||||
runnerState = event;
|
||||
sprite.current = RunnerState.run;
|
||||
break;
|
||||
case "float":
|
||||
print('float');
|
||||
previousState = runnerState;
|
||||
runnerState = event;
|
||||
boost = FlameAudio.audioCache.play('sfx/jet_boost.mp3',
|
||||
volume: 0.25, mode: PlayerMode.LOW_LATENCY);
|
||||
boost = FlameAudio.play('sfx/jet_boost.mp3', volume: 0.25);
|
||||
switch (gameRef.gameState.getRobotLevel()) {
|
||||
case 3:
|
||||
sprite.current = RunnerState.float3;
|
||||
@ -190,25 +198,34 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
sprite.current = RunnerState.float;
|
||||
break;
|
||||
}
|
||||
sprite.addEffect(MoveEffect(
|
||||
path: [sprite.position],
|
||||
duration: 1.5,
|
||||
curve: Curves.ease,
|
||||
onComplete: () {
|
||||
updateLevel();
|
||||
if (onTopOfPlatform()) {
|
||||
this.event("run");
|
||||
} else {
|
||||
this.event("fall");
|
||||
}
|
||||
},
|
||||
));
|
||||
updateLevel();
|
||||
if (onTopOfPlatform()) {
|
||||
this.event("run");
|
||||
} else {
|
||||
this.event("fall");
|
||||
}
|
||||
// sprite.add(MoveToEffect(
|
||||
// sprite.position,
|
||||
// EffectController(
|
||||
// duration: 1.5,
|
||||
// curve: Curves.ease,
|
||||
// ),
|
||||
// onComplete: () {
|
||||
// updateLevel();
|
||||
// if (onTopOfPlatform()) {
|
||||
// this.event("run");
|
||||
// } else {
|
||||
// this.event("fall");
|
||||
// }
|
||||
// },
|
||||
// ));
|
||||
break;
|
||||
case "duck":
|
||||
print('duck');
|
||||
|
||||
previousState = runnerState;
|
||||
runnerState = event;
|
||||
boost = FlameAudio.audioCache
|
||||
.play('sfx/shield.mp3', volume: 0.25, mode: PlayerMode.LOW_LATENCY);
|
||||
boost = FlameAudio.play('sfx/shield.mp3', volume: 0.25);
|
||||
switch (gameRef.gameState.getRobotLevel()) {
|
||||
case 3:
|
||||
sprite.current = RunnerState.duck3;
|
||||
@ -220,24 +237,25 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
sprite.current = RunnerState.duck;
|
||||
break;
|
||||
}
|
||||
sprite.addEffect(MoveEffect(
|
||||
path: [sprite.position],
|
||||
duration: 1.5,
|
||||
curve: Curves.linear,
|
||||
sprite.add(MoveToEffect(
|
||||
sprite.position,
|
||||
EffectController(
|
||||
duration: 1.5,
|
||||
curve: Curves.linear,
|
||||
),
|
||||
onComplete: () {
|
||||
if (boost != null) {
|
||||
boost.then((value) => value.stop());
|
||||
}
|
||||
boost.then((value) => value.stop());
|
||||
this.event("run");
|
||||
},
|
||||
));
|
||||
break;
|
||||
case "die":
|
||||
print('die');
|
||||
|
||||
if (dead) {
|
||||
return;
|
||||
}
|
||||
FlameAudio.audioCache.play('sfx/fall_death_speed.mp3',
|
||||
volume: 0.5, mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/fall_death_speed.mp3', volume: 0.5);
|
||||
previousState = runnerState;
|
||||
clearEffects();
|
||||
runnerState = event;
|
||||
@ -245,14 +263,14 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
dead = true;
|
||||
friend.stop();
|
||||
gameRef.die();
|
||||
sprite.addEffect(getFallingEffect());
|
||||
sprite.add(getFallingEffect());
|
||||
break;
|
||||
case "electrocute":
|
||||
print('electrocute');
|
||||
if (dead) {
|
||||
return;
|
||||
}
|
||||
FlameAudio.audioCache.play('sfx/fall_death_speed.mp3',
|
||||
volume: 0.5, mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/fall_death_speed.mp3', volume: 0.5);
|
||||
previousState = runnerState;
|
||||
clearEffects();
|
||||
runnerState = event;
|
||||
@ -260,16 +278,17 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
dead = true;
|
||||
friend.stop();
|
||||
gameRef.die();
|
||||
sprite.addEffect(getFallingEffect());
|
||||
sprite.add(getFallingEffect());
|
||||
break;
|
||||
case "glitch":
|
||||
print('glitch');
|
||||
|
||||
if (dead) {
|
||||
return;
|
||||
}
|
||||
FlameAudio.audioCache.play('sfx/glitch_death.mp3',
|
||||
volume: 0.5, mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/glitch_death.mp3', volume: 0.5);
|
||||
previousState = runnerState;
|
||||
clearEffects();
|
||||
// clearEffects();
|
||||
runnerState = event;
|
||||
sprite.current = RunnerState.glitch;
|
||||
dead = true;
|
||||
@ -297,36 +316,52 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
for (MovingObject p in gameRef.platformHolder.objects[i]) {
|
||||
if (estimatedXCoordinate >= p.sprite.x - p.sprite.width / 2 &&
|
||||
estimatedXCoordinate <= p.sprite.x + p.sprite.width) {
|
||||
return MoveEffect(
|
||||
path: [
|
||||
Vector2(sprite.x, (i - 1) * gameRef.blockSize),
|
||||
],
|
||||
duration: time,
|
||||
curve: Curves.ease,
|
||||
return MoveToEffect(
|
||||
Vector2(sprite.x, (i - 1) * gameRef.blockSize),
|
||||
EffectController(
|
||||
duration: time,
|
||||
curve: Curves.ease,
|
||||
),
|
||||
onComplete: () {
|
||||
updateLevel();
|
||||
if (onTopOfPlatform()) {
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/land.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/land.mp3');
|
||||
event("run");
|
||||
} else {
|
||||
event("fall");
|
||||
}
|
||||
},
|
||||
);
|
||||
// return MoveEffect(
|
||||
// path: [
|
||||
// Vector2(sprite.x, (i - 1) * gameRef.blockSize),
|
||||
// ],
|
||||
// duration: time,
|
||||
// curve: Curves.ease,
|
||||
// onComplete: () {
|
||||
// updateLevel();
|
||||
// if (onTopOfPlatform()) {
|
||||
// FlameAudio
|
||||
// .play('sfx/land.mp3');
|
||||
// event("run");
|
||||
// } else {
|
||||
// event("fall");
|
||||
// }
|
||||
// },
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
return MoveEffect(
|
||||
path: [
|
||||
Vector2(sprite.x, 8 * gameRef.blockSize),
|
||||
],
|
||||
duration: 0.2 * (8 - level),
|
||||
curve: Curves.ease,
|
||||
|
||||
return MoveToEffect(
|
||||
Vector2(sprite.x, 8 * gameRef.blockSize),
|
||||
EffectController(
|
||||
duration: 0.2 * (8 - level),
|
||||
curve: Curves.ease,
|
||||
),
|
||||
onComplete: () {
|
||||
updateLevel();
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/land.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/land.mp3');
|
||||
if (onTopOfPlatform()) {
|
||||
event("run");
|
||||
} else {
|
||||
@ -334,6 +369,23 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
}
|
||||
},
|
||||
);
|
||||
// return MoveEffect(
|
||||
// path: [
|
||||
// Vector2(sprite.x, 8 * gameRef.blockSize),
|
||||
// ],
|
||||
// duration: 0.2 * (8 - level),
|
||||
// curve: Curves.ease,
|
||||
// onComplete: () {
|
||||
// updateLevel();
|
||||
// FlameAudio
|
||||
// .play('sfx/land.mp3');
|
||||
// if (onTopOfPlatform()) {
|
||||
// event("run");
|
||||
// } else {
|
||||
// event("fall");
|
||||
// }
|
||||
// },
|
||||
// );
|
||||
}
|
||||
|
||||
// Platform agnostic control input to determine the runners actions.
|
||||
@ -370,7 +422,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
break;
|
||||
case "left":
|
||||
if (runnerState == "kick") {
|
||||
sprite.animation!.reset();
|
||||
sprite.animationTicker!.reset();
|
||||
clearEffects();
|
||||
event("run");
|
||||
}
|
||||
@ -385,9 +437,9 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
event("die");
|
||||
}
|
||||
// If the animation is finished
|
||||
if (sprite.animation?.done() ?? false) {
|
||||
if (sprite.animationTicker?.done() ?? false) {
|
||||
if (!dead) {
|
||||
sprite.animation!.reset();
|
||||
sprite.animationTicker!.reset();
|
||||
if (runnerState == "kick") {
|
||||
event("run");
|
||||
}
|
||||
@ -399,8 +451,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
if (onTopOfPlatform()) {
|
||||
updateLevel();
|
||||
clearEffects();
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/land.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/land.mp3');
|
||||
event("run");
|
||||
}
|
||||
}
|
||||
@ -464,8 +515,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
for (int i = 0; i < coinLevel.length;) {
|
||||
if (coinLevel[i].intersect(runnerRect) != "none") {
|
||||
gameRef.gameState.numCoins++;
|
||||
FlameAudio.audioCache.play('sfx/coin_catch.mp3',
|
||||
volume: 0.25, mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/coin_catch.mp3', volume: 0.25);
|
||||
gameRef.coinHolder.remove(coinLevel, i);
|
||||
continue;
|
||||
}
|
||||
@ -503,8 +553,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
return;
|
||||
}
|
||||
} else if (intersectState == "left" && runnerState == "kick") {
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/bug_death1.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/bug_death1.mp3');
|
||||
bugLevel[i].sprite.current = BugState.breaking;
|
||||
gameRef.coinHolder.generateCoin(gameRef, level,
|
||||
force: true, xPosition: bugLevel[i].sprite.x + gameRef.blockSize);
|
||||
@ -528,8 +577,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
} else if (runnerState == "duck" && intersectState != "above") {
|
||||
continue;
|
||||
} else {
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/obstacle_death.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/obstacle_death.mp3');
|
||||
event("die");
|
||||
}
|
||||
}
|
||||
@ -546,8 +594,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
if (intersectState == "none") {
|
||||
continue;
|
||||
} else {
|
||||
FlameAudio.audioCache
|
||||
.play('sfx/obstacle_death.mp3', mode: PlayerMode.LOW_LATENCY);
|
||||
FlameAudio.play('sfx/obstacle_death.mp3');
|
||||
event("die");
|
||||
}
|
||||
}
|
||||
@ -633,7 +680,7 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
current: RunnerState.run,
|
||||
);
|
||||
|
||||
changePriorityWithoutResorting(RUNNER_PRIORITY);
|
||||
priority = RUNNER_PRIORITY;
|
||||
}
|
||||
|
||||
Future<SpriteAnimation> loadSpriteAnimation(String name, int howManyFrames,
|
||||
@ -661,15 +708,24 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
sprite.y = gameRef.blockSize * level;
|
||||
sprite.size.x = gameRef.blockSize;
|
||||
sprite.size.y = gameRef.blockSize;
|
||||
if (sprite.effects.isNotEmpty) {
|
||||
sprite.effects.first.onComplete!();
|
||||
if (sprite.animations!.isNotEmpty) {
|
||||
sprite.animations?.forEach((key, animation) {
|
||||
sprite.animationTicker?.onComplete!();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void clearEffects({bool keepSounds = false}) {
|
||||
sprite.clearEffects();
|
||||
sprite.animations?.clear();
|
||||
|
||||
if (!keepSounds && boost != null) {
|
||||
boost.then((value) => value.stop());
|
||||
}
|
||||
}
|
||||
|
||||
// void clearEffects({bool keepSounds = false}) {
|
||||
// sprite.clearEffects();
|
||||
// if (!keepSounds) {
|
||||
// audioPlayer.stop();
|
||||
// }
|
||||
}
|
||||
|
@ -6,6 +6,10 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_linux/audioplayers_linux_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
|
||||
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
|
||||
}
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_linux
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
@ -13,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
475
pubspec.lock
475
pubspec.lock
@ -5,133 +5,215 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "6bd38d335f0954f5fad9c79e614604fbf03a0e5b975923dd001b6ea965ef5b4b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.5"
|
||||
version: "3.6.0"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.5.0"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.8.1"
|
||||
version: "2.11.0"
|
||||
audioplayers:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: audioplayers
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: c05c6147124cd63e725e861335a8b4d57300b80e6e92cea7c145c739223bbaef
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.19.1"
|
||||
version: "5.2.1"
|
||||
audioplayers_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_android
|
||||
sha256: b00e1a0e11365d88576320ec2d8c192bc21f1afb6c0e5995d1c57ae63156acb5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.3"
|
||||
audioplayers_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_darwin
|
||||
sha256: "3034e99a6df8d101da0f5082dcca0a2a99db62ab1d4ddb3277bed3f6f81afe08"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.2"
|
||||
audioplayers_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_linux
|
||||
sha256: "60787e73fefc4d2e0b9c02c69885402177e818e4e27ef087074cf27c02246c9e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
audioplayers_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_platform_interface
|
||||
sha256: "365c547f1bb9e77d94dd1687903a668d8f7ac3409e48e6e6a3668a1ac2982adb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
audioplayers_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_web
|
||||
sha256: "22cd0173e54d92bd9b2c80b1204eb1eb159ece87475ab58c9788a70ec43c2a62"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
audioplayers_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: audioplayers_windows
|
||||
sha256: "9536812c9103563644ada2ef45ae523806b0745f7a78e89d1b5fb1951de90e1a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.1"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
charcode:
|
||||
version: "1.3.0"
|
||||
checked_yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
name: checked_yaml
|
||||
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "2.0.3"
|
||||
cli_util:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cli_util
|
||||
sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.18.0"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.3"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
version: "1.0.8"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.1"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "2.1.2"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
version: "7.0.0"
|
||||
fixnum:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fixnum
|
||||
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
flame:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flame
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: da1812e2f17a8ffd5d43ea6a83137794e7f482bcf50419bc9847b8efdb39f791
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0-releasecandidate.13"
|
||||
version: "1.17.0"
|
||||
flame_audio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flame_audio
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a3798e22f744726320f1368c078de01bbde9910d7e3a0537ce217b7f99615f80
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.0-rc.1"
|
||||
version: "2.10.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct dev"
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_launcher_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.2"
|
||||
version: "0.13.1"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
version: "3.0.2"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -146,191 +228,258 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.3"
|
||||
version: "1.2.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.2"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
version: "4.2.0"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.3"
|
||||
version: "0.6.7"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.9.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.4"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "3.0.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.10"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
version: "1.12.0"
|
||||
ordered_set:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ordered_set
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "1bfaaaee0419e43ecc9eaebd410eb4bd5039657b72011de75ff3e2915c9aac60"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "5.0.3"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.9.0"
|
||||
path_provider:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
version: "2.1.3"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.4"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_foundation
|
||||
sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
path_provider_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.2.1"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
version: "2.1.2"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "2.2.1"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: petitparser
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.3.0"
|
||||
version: "6.0.2"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: platform
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "3.1.4"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: plugin_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: process
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.2.3"
|
||||
version: "2.1.8"
|
||||
qr:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: qr
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "3.0.1"
|
||||
qr_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: qr_flutter
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.1.0"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: shared_preferences
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
version: "2.2.3"
|
||||
shared_preferences_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_android
|
||||
sha256: "1ee8bf911094a1b592de7ab29add6f826a7331fb854273d55918693d5364a1f2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
shared_preferences_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_foundation
|
||||
sha256: "0a8a893bf4fd1152f93fec03a415d11c27c74454d96e2318a7ac38dd18683ab7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
shared_preferences_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
shared_preferences_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.3.2"
|
||||
shared_preferences_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "2.3.2"
|
||||
shared_preferences_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_web
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.3.0"
|
||||
shared_preferences_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.3.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -340,100 +489,138 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.10.0"
|
||||
sprintf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sprintf
|
||||
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.2.0"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: synchronized
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0"
|
||||
version: "3.1.0+1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.7.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.2"
|
||||
uuid:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: uuid
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.4"
|
||||
version: "4.4.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "14.2.1"
|
||||
web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.1"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.9"
|
||||
version: "5.5.1"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xdg_directories
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
version: "1.0.4"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xml
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.3.0"
|
||||
version: "6.5.0"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
flutter: ">=2.5.0"
|
||||
dart: ">=3.4.0 <4.0.0"
|
||||
flutter: ">=3.19.0"
|
||||
|
22
pubspec.yaml
22
pubspec.yaml
@ -18,21 +18,23 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
sdk: '>=3.2.4 <4.0.0'
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flame: "^1.0.0-releasecandidate.11"
|
||||
flame_audio: "^1.0.0-rc.1"
|
||||
http: ^0.13.3
|
||||
qr_flutter: ^4.0.0
|
||||
shared_preferences: ^2.0.8
|
||||
flame: ^1.15.0
|
||||
flame_audio: ^2.10.1
|
||||
http: ^1.2.0
|
||||
qr_flutter: ^4.1.0
|
||||
shared_preferences: ^2.2.2
|
||||
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.2
|
||||
cupertino_icons: ^1.0.6
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
audioplayers: ^5.2.1
|
||||
|
||||
flutter_icons:
|
||||
android: "launcher_icon"
|
||||
@ -40,10 +42,9 @@ flutter_icons:
|
||||
image_path: "assets/icon/head-logo.png"
|
||||
|
||||
dev_dependencies:
|
||||
flutter_lints: ^1.0.4
|
||||
flutter_lints: ^3.0.2
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_launcher_icons: "^0.9.2"
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
@ -86,5 +87,4 @@ flutter:
|
||||
fonts:
|
||||
- family: Codystar
|
||||
fonts:
|
||||
- asset: assets/fonts/Codystar-Regular.ttf
|
||||
|
||||
- asset: assets/fonts/Codystar-Regular.ttf
|
@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
|
||||
# https://github.com/flutter/flutter/issues/57146.
|
||||
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
|
||||
|
||||
# Set fallback configurations for older versions of the flutter tool.
|
||||
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
|
||||
set(FLUTTER_TARGET_PLATFORM "windows-x64")
|
||||
endif()
|
||||
|
||||
# === Flutter Library ===
|
||||
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
|
||||
|
||||
@ -91,7 +96,7 @@ add_custom_command(
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
${FLUTTER_TOOL_ENVIRONMENT}
|
||||
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
|
||||
windows-x64 $<CONFIG>
|
||||
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
|
||||
VERBATIM
|
||||
)
|
||||
add_custom_target(flutter_assemble DEPENDS
|
||||
|
@ -6,6 +6,9 @@
|
||||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <audioplayers_windows/audioplayers_windows_plugin.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
AudioplayersWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
|
||||
}
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
audioplayers_windows
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
@ -13,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
@ -60,14 +60,14 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
|
||||
// Version
|
||||
//
|
||||
|
||||
#ifdef FLUTTER_BUILD_NUMBER
|
||||
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
|
||||
#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
|
||||
#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
|
||||
#else
|
||||
#define VERSION_AS_NUMBER 1,0,0
|
||||
#define VERSION_AS_NUMBER 1,0,0,0
|
||||
#endif
|
||||
|
||||
#ifdef FLUTTER_BUILD_NAME
|
||||
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME
|
||||
#if defined(FLUTTER_VERSION)
|
||||
#define VERSION_AS_STRING FLUTTER_VERSION
|
||||
#else
|
||||
#define VERSION_AS_STRING "1.0.0"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user