Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
8 changes: 3 additions & 5 deletions lib/components/background_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ class BackgroundTile extends ParallaxComponent {
final String color;
BackgroundTile({
this.color = 'Gray',
position,
}) : super(
position: position,
);
super.position,
});

final double scrollSpeed = 40;

@override
FutureOr<void> onLoad() async {
priority = -10;
size = Vector2.all(64);
parallax = await gameRef.loadParallax(
parallax = await game.loadParallax(
[ParallaxImageData('Background/$color.png')],
baseVelocity: Vector2(0, -scrollSpeed),
repeat: ImageRepeat.repeat,
Expand Down
9 changes: 3 additions & 6 deletions lib/components/checkpoint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import 'package:pixel_adventure/pixel_adventure.dart';
class Checkpoint extends SpriteAnimationComponent
with HasGameRef<PixelAdventure>, CollisionCallbacks {
Checkpoint({
position,
size,
}) : super(
position: position,
size: size,
);
super.position,
super.size,
});

@override
FutureOr<void> onLoad() {
Expand Down
9 changes: 3 additions & 6 deletions lib/components/collision_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import 'package:flame/components.dart';
class CollisionBlock extends PositionComponent {
bool isPlatform;
CollisionBlock({
position,
size,
super.position,
super.size,
this.isPlatform = false,
}) : super(
position: position,
size: size,
) {
}) {
// debugMode = true;
}
}
9 changes: 3 additions & 6 deletions lib/components/fruit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ class Fruit extends SpriteAnimationComponent
final String fruit;
Fruit({
this.fruit = 'Apple',
position,
size,
}) : super(
position: position,
size: size,
);
super.position,
super.size,
});

final double stepTime = 0.05;
final hitbox = CustomHitbox(
Expand Down
9 changes: 5 additions & 4 deletions lib/components/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class Player extends SpriteAnimationGroupComponent
with HasGameRef<PixelAdventure>, KeyboardHandler, CollisionCallbacks {
String character;
Player({
position,
super.position,
this.character = 'Ninja Frog',
}) : super(position: position);
});

final double stepTime = 0.05;
late final SpriteAnimation idleAnimation;
Expand Down Expand Up @@ -95,7 +95,7 @@ class Player extends SpriteAnimationGroupComponent
}

@override
bool onKeyEvent(RawKeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
bool onKeyEvent(KeyEvent event, Set<LogicalKeyboardKey> keysPressed) {
horizontalMovement = 0;
final isLeftKeyPressed = keysPressed.contains(LogicalKeyboardKey.keyA) ||
keysPressed.contains(LogicalKeyboardKey.arrowLeft);
Expand All @@ -107,7 +107,8 @@ class Player extends SpriteAnimationGroupComponent

hasJumped = keysPressed.contains(LogicalKeyboardKey.space);

return super.onKeyEvent(event, keysPressed);
// Return false to indicate that we have handled the key event.
return false;
}

@override
Expand Down
9 changes: 3 additions & 6 deletions lib/components/saw.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ class Saw extends SpriteAnimationComponent with HasGameRef<PixelAdventure> {
this.isVertical = false,
this.offNeg = 0,
this.offPos = 0,
position,
size,
}) : super(
position: position,
size: size,
);
super.position,
super.size,
});

static const double sawSpeed = 0.03;
static const moveSpeed = 50;
Expand Down
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
43 changes: 43 additions & 0 deletions macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
29 changes: 29 additions & 0 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PODS:
- audioplayers_darwin (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS

DEPENDENCIES:
- audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)

EXTERNAL SOURCES:
audioplayers_darwin:
:path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos
FlutterMacOS:
:path: Flutter/ephemeral
path_provider_foundation:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin

SPEC CHECKSUMS:
audioplayers_darwin: dcad41de4fbd0099cb3749f7ab3b0cb8f70b810c
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943

PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

COCOAPODS: 1.15.2
Loading