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