Skip to content

Instantly share code, notes, and snippets.

@override
bool onKeyEvent(RawKeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
final isKeyUp = event is RawKeyUpEvent;
//
if (isKeyUp) {
if (current == PlayerState.right || current == PlayerState.left || current == PlayerState.jump) {
stop();
current = PlayerState.regular;
}
}
enum PlayerState { regular, duck, left, right, jump, hit, shoot }
...
@override
Future<void> onLoad() async {
await super.onLoad();
await _loadCharacterSprites();
// Added World
import 'package:flame/components.dart';
import 'package:flame/parallax.dart';
import 'package:flutter/material.dart';
import 'package:flutter_flame_showcase/main.dart';
class MkWorld extends ParallaxComponent<MortalKombat> {
@override
Future<void> onLoad() async {
void main() {
runApp(const MortalKombatGame());
}
class MortalKombatGame extends StatefulWidget {
const MortalKombatGame({super.key});
@override
State<MortalKombatGame> createState() => _MortalKombatGameState();
}
@vbalagovic
vbalagovic / fvm_cleaner.sh
Created November 30, 2022 16:02
Switching between multiple flutter versions and projects can cause issue (or project upgrade) this commands will clean your project to run again.
rm -Rf ios/Pods && \
rm -Rf ios/.symlinks && \
rm -Rf ios/Flutter/Flutter.framework && \
rm -Rf ios/Flutter/Flutter.podspec && \
rm -rf ~/.pub-cache && \
fvm flutter pub get && \
cd ios && fvm flutter precache --ios && pod install --repo-update && cd ..
cd android && fastlane deploy_beta --env production && cd ../ios && fastlane deploy_beta --env production && cd ..
#Ruby version
ruby_version("3.0.2")
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
fastlane_require 'dotenv'
default_platform(:ios)
IOS_SCHEME = "prod"
IOS_BUNDLE_IDENTIFIER="app.name.io"
IOS_FIREBASE_APP_DISTRIBUTION_APP="1:299788468872:ios:2bbe7asdasdaasd0f6034dd553d"
IOS_FIREBASE_APP_DISTRIBUTION_RELEASE_NOTES="Test Deployment"
IOS_FIREBASE_APP_DISTRIBUTION_TESTERS="vedran@qedcode.io"
IOS_FIREBASE_APP_DISTRIBUTION_CREDENTIALS_FILE_PATH="$PWD/fastlane/google-creds-prod.json"
FLUTTER_VERSION=3.3.5
# Apple team ID
IOS_TEAM_ID='UDW7676AD'
fastlane deploy_beta --env production
ANDROID_SCHEME = "prod"
# App identifier
ANDROID_BUNDLE_IDENTIFIER="app.name.prod"
# Firebase app id (you can find it in project settings)
ANDROID_FIREBASE_APP_DISTRIBUTION_APP="1:299788468872:android:234234234234234"
# Release Notes
ANDROID_FIREBASE_APP_DISTRIBUTION_RELEASE_NOTES="Test Deployment"
# Testers, separate with comma
ANDROID_FIREBASE_APP_DISTRIBUTION_TESTERS="vedran.balagovic@gmail.com"
# Path to google credentials file